How to use R and t from the extrinsic camera parameters to do the image calibration?
16 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I recently use MatLab to do my image analysis, to measure the particles size and area in the image. As I have many images, I want to do the calibration for the camera and the images, in order to have a accurate data. For generating the intrinsic camera parameters, I use Camera Calibration App in MatLab to do that. For generating the extrinsic camera parameters, I used code like the following:
% Detect the checkerboard.
[imagePoints, boardSize]= detectCheckerboardPoints(im);
% Compute rotation and translation of the camera.
[R, t] = extrinsics(imagePoints, worldPoints, cameraParams);
Basically I calibrate the camera and the images by following the steps in this . But I don't know what to do after generating the R and t value. I mean, how can I use R and t value to calculate the calibration factor? I use regionprops() to collect the area of the particles I want in the image. How can I use R and t value to translate the area in pixel into the world scale?
(1) I have tried pointsToWorld to change the area structure from regionprops call, but it gave an error, complaining the input should be numeric.
(2) In the example, there some lines I don't really understand:
% Get the top-left and the top-right corners.
box1 = double(boxes(1, :));
imagePoints1 = [box1(1:2);box1(1) + box1(3), box1(2)]; %what does this step do?
% Get the world coordinates of the corners
worldPoints1 = pointsToWorld(cameraParams, R, t, imagePoints1);
% Compute the diameter of the coin in millimeters.
d = worldPoints1(2, :) - worldPoints1(1, :);
diameterInMillimeters = hypot(d(1), d(2));
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Camera Calibration dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!