You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The calibrateCamera() function can return distortion coefficients k1, k2... k6 that lead to a distortion model that is ill-defined. The denominator of the radial distortion part (1 + k4 r^2 + k5 r^4 + k6 r^6) can have roots r_i such that r_i^2 = ((u-cx)/fx)^2 + ((v-cy)/fy)^2 for some real-valued image points coordinates (u, v) within the image boundaries.
As a consequence, all image points located in the vicinity of this ellipsis may be attributed an incorrect value by the remap function, as the rectification maps will contain invalid coordinates.
This was observed after calibrating with a set of images in which the chessboard was placed mostly near the image center, so my guess is that the lack of constraints further from the center could explain why the optimization could converge towards such a solution. A work around is to check at the end of the calibration process that the radial distortion model is well-defined for every image pixel coordinates − i.e. compute the roots of the polynomial at the denominator.
My question is: when the rational distortion model is used, shouldn't the optimization be constrained in a way that prevents convergence towards such ill-defined sets of coefficients?
set of images in which the chessboard was placed mostly near the image center
This is incomplete input for calibrateCamera(). For best results you should cover all parts of camera frame including sides and corners.
Check reprojection error. If it is minimal then algo works "correctly" with provided constraints(input).
Detection of lack of constraints is currently out of scope.
Yes, I understand that with the input data set the calibration cannot be expected to be accurate over the whole field of view, only on the sub-part covered by the calibration images. Still, I think there is a difference between having a model which only approximates the actual distortion over a part of the field of view and a model which exhibits singularities (division by zero).
Also, except for very low distortion lenses, it is sometimes difficult if not impossible to place a chessboard corner near the image corners, which means that there is always a part of the field of view left unexplored.
Then I agree that with a good acquisition procedure (i.e. enough constraints) this should not happen.
Detection of lack of constraints is currently out of scope.
Got it, we can live with it and implement our own checks.
Hi everyone,
The calibrateCamera() function can return distortion coefficients
k1, k2... k6
that lead to a distortion model that is ill-defined. The denominator of the radial distortion part(1 + k4 r^2 + k5 r^4 + k6 r^6)
can have rootsr_i
such thatr_i^2 = ((u-cx)/fx)^2 + ((v-cy)/fy)^2
for some real-valued image points coordinates(u, v)
within the image boundaries.As a consequence, all image points located in the vicinity of this ellipsis may be attributed an incorrect value by the remap function, as the rectification maps will contain invalid coordinates.
This was observed after calibrating with a set of images in which the chessboard was placed mostly near the image center, so my guess is that the lack of constraints further from the center could explain why the optimization could converge towards such a solution. A work around is to check at the end of the calibration process that the radial distortion model is well-defined for every image pixel coordinates − i.e. compute the roots of the polynomial at the denominator.
My question is: when the rational distortion model is used, shouldn't the optimization be constrained in a way that prevents convergence towards such ill-defined sets of coefficients?
Here are the parameters found:
Steps to reproduce
I can provide calibration images upon request.
System information (version)
The text was updated successfully, but these errors were encountered: