How to use R and t from the extrinsic camera parameters to do the image calibration?

16 vues (au cours des 30 derniers jours)
Ziming Zhong
Ziming Zhong le 18 Déc 2017
Modifié(e) : Ziming Zhong le 18 Déc 2017
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));

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by