0
$\begingroup$

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]
$\endgroup$
  • $\begingroup$ Hi ! If you have any relevant code, please, add it. $\endgroup$ – Sektor Feb 25 '15 at 21:43
  • $\begingroup$ ImageTransformation[image,function]. $\endgroup$ – David G. Stork Feb 25 '15 at 21:51
  • $\begingroup$ 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] $\endgroup$ – dimitrij2510 Feb 25 '15 at 21:57
  • $\begingroup$ I tried the ImageTransformation command, but I'm not sure how to create a function relating my distorted set of points to my undistorted set. Any suggestions? $\endgroup$ – dimitrij2510 Feb 25 '15 at 21:58
  • $\begingroup$ In order to construct a transformation function, you'll need to know what form the transformation takes. Maybe you can post examples of a distorted and undistorted image, or at least the pairs of points in the two images. $\endgroup$ – 2012rcampion Feb 25 '15 at 23:21
1
$\begingroup$

There's a really nice paper on this subject by Bennink et al. (2007) titled "Warping a Neuro-Anatomy Atlas on 3D MRI Data with Radial Basis Functions". The Appendix to the paper includes a Mathematica code. See:

https://www.google.com/?gws_rd=ssl#q=warping+a+neuroanatomy+atlas

$\endgroup$
  • $\begingroup$ Thanks, this looks great! Do you know how I might be able to use the RadialBasisInterpolation and RadialBasisNorm commands? They don't seem to work with Mathematica 10...any suggestions? Thanks again! $\endgroup$ – dimitrij2510 Feb 27 '15 at 0:11
  • $\begingroup$ Actually, I only toyed with Bennink et al.'s code, and I worked from another version of their paper that included a slightly different code (I can send you the pdf if you'd like.) Also, I haven't upgraded yet to version 10. I also toyed with a different RBF code by Dahl and that author's RBF MMA code package (called Obtuse.m). You can easily find it via a Google search. I can send you a number of references, in the form of PDF files. My email address is "fschwab" at "nrao.edu". $\endgroup$ – user15994 Feb 27 '15 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.