1

I am trying to calibrate a fisheye camera with this OpenCV module. As far as I know, it supports the calibration for cameras with a FOV up to 150ยบ. When running the calibration procces, I get some results for the intrisics and the lens distorsion that looks great.

K = [650.8   0.51     0
       0      651.6   1024
       0       0     1026.4]

d = [-0.34177 0.09135 0.94044 0.00271]

If I use the function cv::fisheye::undistortImage I am getting a fuzzy image.

I thought that the calibration was wrong but I repeat the process with the function fisheye::initUndistortRectifyMap and then cv::remap to obtain the rectified image.

The result looks great. The problem is that I want to increase the FOV. I have read that I can change the focal length as here. In my case if I do this I am not able to see the black background but the image zooms out instead.

I have tried changing the focal length and also estimating the new camera matrix with fisheye::estimateNewCameraMatrixForUndistortRectify() and balance parameter but the result is the same.

My questions are:

  1. What is the difference between cv::fisheye::undistortImage and remmaping process?
  2. What am I doing wrong so I can not increase the FOV without doing the zooming effect?

The code used once the camera intrinsics are generated is:

Mat map1, map2;
Mat imageUndistorted;

Mat knew;
knew = camera.k.clone();
//knew.at<double>(0, 0) = camera.k.at<double>(0, 0) / 4;
//knew.at<double>(1, 1) = camera.k.at<double>(1, 1) / 4;
fisheye::estimateNewCameraMatrixForUndistortRectify(camera.k, camera.d, image.size(), cv::Matx33f::eye(), knew,0.5,image.size());
//fisheye::undistortImage(image, imageUndistorted, camera.k, camera.d, cv::noArray(), image.size());

fisheye::initUndistortRectifyMap(camera.k, camera.d, cv::Matx33d::eye(), knew, image.size(), CV_32FC1, map1, map2);
remap(image, imageUndistorted, map1, map2, INTER_LINEAR, BORDER_CONSTANT);
Peter Csala
  • 17,736
  • 16
  • 35
  • 75

0 Answers0