Issues with computing extrinsic matrices after camera calibration
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am using the camera calibrator app on matlab 2014a. I used the attached images for calibration. Then I want to compute the extrinsic parameters for other images. I wrote the following code according to the documentation in matlab.
function [rotationmatrix,translationvector] = extrinsic(imagefile,cameraParameters)
imOrig=imread(imagefile);
im = undistortImage(imOrig, cameraParameters);
[imagePoints, boardSize] = detectCheckerboardPoints(im);
squareSize = 2.43; % in millimeters
worldPoints = generateCheckerboardPoints(boardSize, squareSize);
[rotationmatrix, translationvector] = extrinsics(imagePoints, worldPoints, cameraParameters);
end
To verify that my code works, I have tested it with the first image I used for calibration. I have obtained the extrinsic rotation and translation matrices using this code and the calibration parameters. Then I compared them to the matrices that I have directly from calibration. They shoudl be equal. Actually, they are very similar but not identical (averaging 1 mm difference for each matrix coordinate). Do you know why?
0 Commenti
Risposta accettata
Dima Lisin
il 1 Mag 2014
During calibration, all camera parameters, including the translations and rotations of all checkerboards are estimated jointly using a numeric optimization algorithm. In other words, you are trying to fit all the parameters to minimize the reprojection error. On the other hand, when you call extrinsics() you are computing only the rotation and translation for the single checkerboard, and you are computing it in closed form using the parameters that you have just estimated. This is why the results are not exactly the same.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su MATLAB Support Package for USB Webcams in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!