Wide angle lenses calibration with Opencv

六眼飞鱼酱① 提交于 2019-12-21 10:43:15

问题


I'm using a wide-angle lens (178º Diagonal FOV ) and I'm trying to calibrate it properly using Opencv Calibration module. All the detection and calibration process are working fine, but the result is very poor.

I have tried many different configurations:

  • Different set of images
  • Different radial coefficient numbers: 2,3,4,5 even 6.(CV_CALIB_FIX_K1,...,CV_CALIB_FIX_K6 )
  • Fixing principal point and tangential disortion to 0 (CV_CALIB_FIX_ASPECT_RATIO, CV_CALIB_FIX_PRINCIPAL_POINT)
  • Using expected focal length as initial camera matrix. (CV_CALIB_USE_INTRINSIC_GUESS)

The best I can get is something like:

Any ideas about how could I get a good calibration? Do you think using two calibrattion patterns at the same time, or using a circles grid as calibration pattern would help?

I've seen in opencv 3.0 thin prism coeffs are added. I haven't tried it, but I don't think there will make a difference, right? Edit: Checked it... Nothing


回答1:


fisheye lenses have different distortion modelling. For calibrating a fisheye camera, use opencv fisheye module. See opnecv docs.




回答2:


Are you making sure to use the CV_CALIB_RATIONAL_MODEL flag? That will tell OpenCV to use a model that supports wider angle lenses.

Here are my suggestions for a 150 deg lens. You might also consider trying April Cal which I have had decent luck with.




回答3:


Maybe the camera/lens model of OpenCV does not describe accurately enough your ultra wide angle lens. And so maybe you 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 Ultrawide Fisheye Lens Cameras by Eigenvalue Minimization," 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 ultrawide fisheye lens cameras by imposing the constraint that collinear points be rectified to be collinear, parallel lines to be parallel, and orthogonal lines to be orthogonal. Exploiting the fact that line fitting reduces to an eigenvalue problem in 3D, we do a rigorous perturbation analysis to obtain a practical calibration procedure. Doing experiments, we point out that spurious solutions exist if collinearity and parallelism alone are imposed. Our technique has many desirable properties. For example, no metric information is required about the reference pattern or the camera position, and separate stripe patterns can be displayed on a video screen to generate a virtual grid, eliminating the grid point extraction processing.




回答4:


I don't have any experiences with fish-eye lenses, but if you are planing to map the image to a perspective projection, you will run into trouble. The large viewing angle parts of the image will map to very far distances on the image plane. This might acctually result in an image like the one you provided. There are definitely some errors, but it seems that most of the straight "world lines" map to straight "image lines".

What exactly did you expect as the result and what are you planing to use this calibration for?




回答5:


Since Opencv 2.4.10 and above there is a specfic distortion model for wide-angle/fisheye lenses able to handle this strong radial distortion. I've tested with my datasets and results are very good.




回答6:


OpenCV 2.4.10 and above have fisheye camera calibration module. But this module uses a method based on pin-hole camera model. In this model we have an angle between an optical axis of camera and ray of light from some object in front of camera. We also have an angle between optical axis and direction to point on undistorted image (corresponding to object). If calibration was performed correctly, these 2 angles will be equal. It means that if FOV of your camera is about 180 degrees, the distanse from center of undistorted image to edge of undistorted image will be equal to infinity. As a result OpenCV fisheye correction module (cv::fisheye) undistorts only a central part of image. In my own results I got 140-150 degrees FOV in undistorted image. More detailed explanation I placed HERE. If FOV about 140-150 degrees is suitable for you, you can use cv::fisheye without any modification



来源:https://stackoverflow.com/questions/20121976/wide-angle-lenses-calibration-with-opencv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!