问题
I am working on Fisheye camera calibration, and I'm not getting the expected result and I don't know where I'm wrong. I'm new to this camera calibration.
My Parameters from calibration
Focal Length: fc = [ 410.7476 408.0925 ]
Principal point: cc = [ 369.3690 299.0193 ]
Skew: alpha_c = [ 0.8336 ]
Fisheye Distortion: kc = [ -0.3726 0.0931 0.0107 0.0000 ]
My code to undistort:
fisheye::estimateNewCameraMatrixForUndistortRectify(intrinsic, distCoeffs, input.size(), Matx33d::eye(), newK, 1);
fisheye::undistortImage(input, output, intrinsic, distCoeffs, newK, input.size());//Size(640,360));
This is my input image:
This is what I get as output:
回答1:
I don't think, that your Result is coming from a wrong use of the undistort functions. I think, that your Camera Matrix from the Calibration is wrong. You should try that again. And don't forget, you have to take ~20 Images with your Camera also you should make sure, that you used different viewports to take the images of the chessboard or circlegrid. After That Undistort an Image and look at the Result.
I also got sometimes bad results with the camera calibration, but after a successful calibration and a good Camera Matrix everything was fine.
Even in this Tutorial he mentions, that the calibration could give you sometimes bad results.
回答2:
It's possible to get good results in undistortion of fisheye image without using fisheye::estimateNewCameraMatrixForUndistortRectify()
and fisheye::undistortImage()
at all.
After obtaining K (camera matrix) and D (distortion coeffs) via fisheye::calibrate()
, you can put them directly to initUndistortRectifyMap()
. This will produce maps for undistorted image production via cv::remap()
来源:https://stackoverflow.com/questions/41096429/fisheye-camera-calibration