I was hoping someone might be able to help me undistort an image in Mathematica. The distortion doesn't follow any specific pattern, but there are several points on the distorted image that I am able to extract. I also have the corresponding set of corrected, undistorted points. My question is how to warp the distorted image in such a way as to match the distorted points with the undistorted set of points, therefore correcting the distortion. I tried using an old warp matrix command from Mathematica 6, but it was not as faithful as I would like. Any ideas? Thanks in advance!
This is my current code, but it isn't as faithful as I would like:
Wf = WarpMatrix[Reverse /@ dpoints, Reverse /@ ppoints, 3]; MatrixForm[Wf]; newimg = ImageWarp[img, Wf, InterpolationOrder -> 3]