Issues with computing extrinsic matrices after camera calibration
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Dima Lisin
le 1 Mai 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur MATLAB Support Package for USB Webcams dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!