Wide angle lens calibration with Opencv

I use a wide-angle lens (178º FOV diagonal) and I am trying to calibrate it correctly using the Opencv calibration module. The entire detection and calibration process works fine, but the result is very low.

I tried many different configurations:

  • Different set of images
  • Different radial coefficients: 2,3,4,5 even 6. (CV_CALIB_FIX_K1, ..., CV_CALIB_FIX_K6)
  • Fixing the base point and tangential deviation to 0 (CV_CALIB_FIX_ASPECT_RATIO, CV_CALIB_FIX_PRINCIPAL_POINT)
  • Using the expected focal length as the source camera matrix. (CV_CALIB_USE_INTRINSIC_GUESS)

The best I can get is something like: Bad calibration

Any ideas on how I can get a good calibration? What do you think, using two calibration patterns at the same time or using a circle grid as a calibration pattern?

I saw opencv 3.0 subtle prism coefficients. I have not tried, but I do not think it will matter, right? Edit: verified ... nothing

+7
opencv computer-vision camera calibration camera-calibration
source share
6 answers

Since Opencv 2.4.10 and higher, there is a spectral distortion model for wide-angle / fisheye lenses that can handle this strong radial distortion. I tested my data and the results are very good.

+1
source share

The OpenCV camera / lens model may not accurately describe your ultra wide angle lens. And therefore, you may have to abandon the built-in OpenCV calibration procedure and write your own calibration procedure.

For example, a google search gives me:

Kanatani K., “Calibration of Ultra-Optic Photo Lenses by the Eigenvaluation Method”, “Pattern Analysis and Machine Intelligence, IEEE Transactions on, vol. 35, No. 4, pp. 813,822, April 2013.

Abstract: We present a new technique for calibrating ultra-high fisheye lenses, imposing a limitation on the fact that collinear points are straightened to be collinear, parallel lines that should be parallel, and orthogonal lines are orthogonal. Using the fact that the string fitting reduces to the eigenvalue problem in 3D, we do a rigorous analysis of perturbation to get a practical calibration procedure. By conducting experiments, we indicate that false solutions exist if collinearity and parallelism. Our technique has many desirable properties. For example, no metric information is required about the reference template or camera position, and split stripe patterns can be displayed on the video screen to create a virtual grid that eliminates grid selection processing.

+3
source share

Are you sure you are using the CV_CALIB_RATIONAL_MODEL flag? This will allow OpenCV to use a model that supports wider angular lenses.

Here are my suggestions for a 150 degree lens. You could also try trying April Cal , with whom I had decent luck.

+2
source share

I have no experience with red-eye lenses, but if you plan to display the image in perspective, you will have problems. Large angular portions of the image will be displayed over very large distances on the image plane. This can result in an image similar to the one you provided. Of course, there are some errors, but it seems that most of the direct "world lines" correspond to the direct "image lines."

What exactly did you expect as a result and what do you plan to use for this calibration?

+1
source share

fisheye lenses have different distortion modeling. Use the opisv fisheye module to calibrate the fisheye camera. See opnecv docs .

+1
source share

OpenCV 2.4.10 and higher have a fisheye camera calibration module. But this module uses a method based on a model of a camera with holes. In this model, we have an angle between the optical axis of the camera and a ray of light from an object in front of the camera. We also have an angle between the optical axis and the direction to the point in the undistorted image (corresponding to the object). If calibrated correctly, these 2 angles will be equal. This means that if your camera’s FOV is around 180 degrees, the distance from the center of the undistorted image to the edge of the undistorted image will be infinity. As a result, the fisheye OpenCV correction module (cv :: fisheye) distorts only the central part of the image. In my own results, I got 140-150 degrees FOV in an undistorted image. I have posted a more detailed explanation HERE . If a FOV of about 140-150 degrees is suitable for you, you can use cv :: fisheye without any changes.

0
source share

All Articles