Locally weighted homography estimation and non-parameteric lens distortion correction