user3178756
user3178756

Reputation: 595

Multiple camera calibration

I have multiple cameras which I have calibrated them individually, and I have chosen a fixed frame to calibrate their extrinsic matrix to get their rotation and transformation w.r.t the calibration pattern. So, in this case, all these cameras are rotated and transferred w.r.t the pattern and the pattern is the origin. What if I want to move the origin to the camera 1 and re-calculate these matrices w.r.t the first camera?

EDIT:

T_ref = translationVector{1} ;
R_ref = rotationMatrix{1};
Q1_from_t = [rotationMatrix{1} T_ref' ; 0 0 0 1 ];


for i = 1:9
   R = rotationMatrix{i};
   T = translationVector{i};

   Qi_from_t = [R T' ; 0 0 0 1];

   Qi_from_1 =  (Qi_from_t) *(Q1_from_t)^-1;

   R_prime = Qi_from_1(1:3,1:3);
   T_prime = Qi_from_1(1:3,4)';

   figure(2),

   hold on 
   orientation = R_prime^-1;
   location = -T_prime*orientation;


    cam = plotCamera('Location',location,'Orientation',orientation,'Size',20);

end

This is what I get from this script found from here: How to calculate extrinsic parameters of one camera relative to the second camera?

Cameras after moving the origin to the 8th camera

What the camera look like with origin extrinsic coming from calibration.

After transformation

What it looks like after transformation

Upvotes: 2

Views: 683

Answers (1)

Francesco Callari
Francesco Callari

Reputation: 11785

Easiest method is to express the calibrated camera-from-target roto-translations as 4x4 matrices, with the rotation matrix in the upper left 3x3 quadrant, the column-vector translation in the first three rows of the fourth column, and the last row as (0,0,0,1). Call these matrices Qi_from_t, for i in 1,2,...,num_cameras. You want to "convert" the last n-1 ones into Qj_from_1 matrices that express the motions of camera j from the first one. It is: Qj_from_1 = Qj_from_t * Qt_from_1 = Qj_from_t * inv(Q1_from_t) where "*" is the ordinary row-by-column matrix product, and inv() means matrix inversion.

Upvotes: 2

Related Questions