OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Fri, 05 Jul 2013 05:32:04 -0500Lens distortion equation changed - reference please?http://answers.opencv.org/question/6332/lens-distortion-equation-changed-reference-please/
I noticed from this page:
http://docs.opencv.org/trunk/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#id7
That the radial distortion portion of the lens model has changed from previous version such as this
http://opencv.willowgarage.com/documentation/camera_calibration_and_3d_reconstruction.html
Basically the old model was
u = d ( 1 + k_1*d^2 + k_2*d^4 + ...) where "u" is the undistorted radius and "d" is the distorted radius. That appears to have changed to
u = d ( 1 + k_1*d^2 + k_2*d^4 + ...) / ( 1 + q_1*d^2 + q_2*d^4 + ...)
(note in the documentation page q_1 etc are k_4+, and u,d are separated into x", x', y" and y' but hopefully you get the idea.
The older representation I have seen over and over for many years but this new representation is a surprise to me. Is there any references or comments on when this newer model is useful (like more fisheye lenses for example)??
Thanks
Don
Mon, 21 Jan 2013 14:42:07 -0600http://answers.opencv.org/question/6332/lens-distortion-equation-changed-reference-please/Answer by jensenb for <p>I noticed from this page:
<a href="http://docs.opencv.org/trunk/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#id7">http://docs.opencv.org/trunk/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#id7</a></p>
<p>That the radial distortion portion of the lens model has changed from previous version such as this
<a href="http://opencv.willowgarage.com/documentation/camera_calibration_and_3d_reconstruction.html">http://opencv.willowgarage.com/documentation/camera_calibration_and_3d_reconstruction.html</a></p>
<p>Basically the old model was
u = d ( 1 + k_1<em>d^2 + k_2</em>d^4 + ...) where "u" is the undistorted radius and "d" is the distorted radius. That appears to have changed to</p>
<p>u = d ( 1 + k_1<em>d^2 + k_2</em>d^4 + ...) / ( 1 + q_1<em>d^2 + q_2</em>d^4 + ...)</p>
<p>(note in the documentation page q_1 etc are k_4+, and u,d are separated into x", x', y" and y' but hopefully you get the idea.</p>
<p>The older representation I have seen over and over for many years but this new representation is a surprise to me. Is there any references or comments on when this newer model is useful (like more fisheye lenses for example)??</p>
<p>Thanks
Don</p>
http://answers.opencv.org/question/6332/lens-distortion-equation-changed-reference-please/?answer=16234#post-id-16234I think you have things backwards, the "old model" as you called it, better known as the radial distortion model, is as the name implies a nonlinear distortion that is applied to undistorted scene coordinates after perspective division (but before projection onto the image plane) according to their distance to the center of distortion (principle point). Input are the non distorted coordinates before projection, and the output are the warped coordinates that the camera lens will produce. This means that i.e. if you know an object's 3d coordinates in the reference frame of the camera, the radial distortion model tells you where the object's points will end up on the image plane for the given lens and how much deviation there will be from the pinhole projection model.
It is worth noting that the inverse formulation, the mapping between a pair of distorted image coordinates taken from the specific camera lens and the corresponding original undistorted scene coordinatess, does not have a closed form solution for the radial model and has to be solved iteratively using non linear optimization techniques.
The second model is based on the rational model by Claus et al.
- David Claus, Andrew W. Fitzgibbon: A Rational Function Lens Distortion Model for General Cameras. CVPR (1) 2005: 213-219
Note that the model they propose is actually an undistortion model, a mapping between distorted image points and their corresponding undistorted scene points that has a closed form solution, in contrast with the radial distortion model. The OpenCV implementation, however, differs significantly from the method proposed in the paper and is not actually an undistortion model, but simply an extension of the radial distortion model with extra terms k_4 to k_6 in the denominator, with the idea that lenses with more extreme distortions (wide angle, fisheye) can be better modeled with the additional terms.
For a more recent discussion of these models see:
- J. Brito, K.Köser, R.Angst, M. Pollefeys: Radial Distortion Self-Calibration. CVPR 2013
Fri, 05 Jul 2013 05:32:04 -0500http://answers.opencv.org/question/6332/lens-distortion-equation-changed-reference-please/?answer=16234#post-id-16234