问题描述
我必须用鱼眼镜头校准我的相机.
I have to calibrate my camera with a Fisheye lens.
首先,我将OpenCv 2.4与CV_CALIB_RATIONAL_MODEL标志一起使用,以获得更好的结果,但这还不够.之后,我发现OpenCv 3.0具有用于校准的鱼眼功能.
First I used OpenCv 2.4 with the flag CV_CALIB_RATIONAL_MODEL to get better results but it wasn't enough.After, I have seen that OpenCv 3.0 have fisheye function for calibration.
我计算我的objectPoints并使用findChessboardCorners()获得imagePoints,它们似乎是正确的.
I compute my objectPoints and get my imagePoints with findChessboardCorners(), they seem correct.
我的问题是使用 fisheye :: calibrate .我返回的值,例如重投影误差,本征矩阵和失真系数是错误的.它们是-nan值.
My problem is after, with fisheye::calibrate.My returned values such as reprojection error, intrinsic matrix and distorted coefficients are wrong. They are -nan values.
有人知道我在做什么错吗?
Does anyone have any idea what I'm doing wrong?
谢谢
推荐答案
对于新的OpenCV 3.0鱼眼函数,我发现除非指定cv::fisheye::CALIB_RECOMPUTE_EXTRINSIC
标志(例如38像素重投影错误),否则我将无法获得可用的固有校准.另外,我指定了cv::fisheye::CALIB_FIX_SKEW
.当然,您应该指定尽可能多的cv::fisheye::CALIB_FIX_Kx
标志.
For new OpenCV 3.0 fisheye functions, I found I did not get a usable intrinsic calibration unless cv::fisheye::CALIB_RECOMPUTE_EXTRINSIC
flag was specified (e.g. 38 pixel reprojection error). Also, I was specifying cv::fisheye::CALIB_FIX_SKEW
. Of course, you should specify as many cv::fisheye::CALIB_FIX_Kx
flags as you can.
对于我的镜头,这是一个非常简单的微型镜头,但径向变形较大,正常的OpenCV校正功能无法产生准确的校正.通过上面的标志并修复了K2=K3=K4=0
,我能够获得良好的结果.
For my lens, which is a very simple, miniature lens but with big radial distortion, the normal OpenCV rectification functions did not yield accurate rectifications. I was able to get good results with the above flags and fixing K2=K3=K4=0
.
这篇关于使用OpenCv 3.0校准FishEye镜头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!