Question

I know the default OpenCV Calibration systems model a Pinhole camera, but I'm working with a system using extremely wide FOV lens (187-degrees). If there any existing way to do this in OpenCV, or to work with just wide lenses? Or will I have to rewrite all the calibration/undistort for my system?

Was it helpful?

Solution

Seems there's no good OpenCV way to do this.

I wound up using OCamLib to do the actual calibration, then writing my own "undistortPoints" function (using Scaramuzza's algorithms) to undistort 2D image points into 3D unit vectors (rather than 2D points). Unfortunately, this also breaks lots of other stuff in OpenCV because most OpenCV image processing functions expect 2D points and their own pinhole calibration model, so I've had to rebuild significant portions of the code for this.

I welcome any other insight into this.

OTHER TIPS

There is a good reason why people don’t use wide angle lenses much - when images are undistorted, the resulting image is highly non-rectangular and the quality on the edges is so bad that the image needs to be cropped back to… 90 deg FOV. So the question is, why don’t just use 90 deg FOV lens on the first place? The situation gets even worse with stereo cameras and image rectification.

If you really need to have wide FOV use several cameras or rotating camera. Here are some examples: PointGrey Inc.

In order to calibrate camera with extremely wide FOV lens, you can use Omnidirectional Camera module from OpenCV Contrib. It is important to notice that you have to rebuild your OpenCV with OpenCV contribs to use it.

OpenCV fisheye camera calibration 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. More detailed explanation of this limitation I placed HERE.In my own results I got 140-150 degrees FOV in undistorted image. If FOV about 140-150 degrees is suitable for you, you can use cv::fisheye without any modification

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top