Adaptive Non-parametric Rectification