Reputation: 211
I am using Matlab's Camera Calibrator to calibrate a bunch of images from a fisheye camera.
How can I translate the results into OpenCV format?
Results in Matlab:
Format I would like to convert them to:
I looked into and found out that Scaramuzza's model is the one that the Matlab fisheye calibration uses, but I don't see clearly anywhere what exactly each value stands for, or the order.
Edit: The cameraIntrinsicsToOpenCV function provided by Matlab does not work with fisheye models, it is only for pinhole/default camera model, hence the question!
Upvotes: 1
Views: 1554
Reputation: 75
From version R2021b, Matlab has introduced the cameraIntrinsicsToOpenCV
function which does exactly that. Read more here
They also made it bijective with its twin function cameraIntrinsicsFromOpenCV
.
Edit:
For fisheye cameras, use undistortFisheyeImage
function to get the cameraIntrinsics
which will contain all the data for opencv: FocalLength [fx fy] , PrincipalPoint [cx, cy], RadialDistortion [k1 k2 k3] and TangentialDistortion [p1 p2].
[UndistortedImage,camIntrinsics] = undistortFisheyeImage(Image,intrinsics);
Upvotes: 1