3
votes

The lens model in OpenCV is a sort of distortion model which distorts an ideal position to the corresponding real (distorted) position:

  • x_corrected = x_distorted ( 1 + k_1 * r^2 + k_2 * r^4 + ...),
  • y_corrected = y_distorted ( 1 + k_1 * r^2 + k_2 * r^4 + ...),

where r^2 = x_distorted^2 + y_distorted^2 in the normalized image coordinate (the tangential distortion is omitted for simplicity). This is also found in Z. Zhang: "A Flexible New Technique for Camera Calibration," TPAMI 2000, and also in "Camera Calibration Toolbox for Matlab" by Bouguet.

On the other hand, Bradski and Kaehler: "Learning OpenCV" introduces in p.376 the lens model as a correction model which corrects a distorted position to the ideal position:

  • x_distorted = x_corrected ( 1 + k'_1 * r'^2 + k'_2 * r'^4 + ...),
  • y_distorted = y_corrected ( 1 + k'_1 * r'^2 + k'_2 * r'^4 + ...),

where r'^2 = x_corrected^2 + y_corrected^2 in the normalized image coordinate. Hartley and Zisserman: "Multiple View Geometry in Computer Vision" also describes this model.

I understand the both correction and distortion models have advantages and disadvantages in practice. For example, the former makes correction of detected feature point locations easy, while the latter makes the undistortion of the entire image straightforward.

My question is, why they share the same polynomial expression, while they are supposed to be the inverse of each other? I could find this document evaluating the inversibility, but its theoretical background is not clear to me.

Thank you for your help.

2
you might want to provide more detail on both methods so we don't have to search 5 papers and books for what you are talking about. in general both methods have the same goal. they correct the same optical aberration. hence I would expect them to share the same or very similar polynomials - Piglet
Thank you for the comment. I've added the equations. - demachi

2 Answers

2
votes

I think the short answer is: they are just different models, so they're not supposed to be each other's inverse. Like you already wrote, each has its own advantages and disadvantages.

As to inversibility, this depends on the order of the polynomial. A 2nd-order (quadratic) polynomial is easily inverted. A 4th-order requires some more work, but can still be analytically inverted. But as soon as you add a 6th-order term, you'll probably have to resort to numeric methods to find the inverse, because a 5th-order or higher polynomial is not analytically invertible in the general case.

1
votes

According to taylor expansion every formula in world can be written as c0 + c1*x + c2*x^2 + c3*x^3 + c4*x^4... The goal is just discover the constants. In our particular case the expression must be symmetric in x and -x (even function) so the constants in x, x^3, x^5, x^7 are equal to zero.