I am trying to calibrate a fisheye camera with 120° angle of view. It works quite well when using the classical calibration function cv::calibrateCamera() and the rational model. However, the rectified image is still a bit distorted (see images below).
I then tried to use the fisheye calibration function cv::fisheye::calibrate() but it returns me a NaN camera matrix or the following error when i add cv::fisheye::CALIB_CHECK_COND :
OpenCV Error: Assertion failed (svd.w.at<double>(0) / svd.w.at<double>((int)svd.w.total() - 1) < thresh_cond) in CalibrateExtrinsics, file /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/calib3d/src/fisheye.cpp, line 1427 terminate called after throwing an instance of 'cv::Exception'
what(): /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/calib3d/src/fisheye.cpp:1427: error: (-215) svd.w.at<double>(0) / svd.w.at<double>((int)svd.w.total() - 1) < thresh_cond in function CalibrateExtrinsics
I am using exactly the same detected chessboard points in the classical function and in the fisheye function. And it does not change anything when I use more or less images. Did someone has a clue about why it happens ? I already checked similar posts but I wasn't able to find an appropriate solution.
Thanks