0

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

user3178756
  • 555
  • 1
  • 5
  • 17
  • 1
    What if then? Transformation matrices are movements from one point to the other, they are relative, not absolute. You chose the origin point. Usually it doesnt matter which one is the origin, so you just pick the calibration patter. But you can use any – Ander Biguri Apr 08 '18 at 16:54
  • I'm voting to close this question as off-topic because this is a mathematical problem which has nought to do with programming. – Adriaan Apr 08 '18 at 16:55
  • @AnderBiguri Yes that's true, but it would be easier to have one of the cameras as the origin of the world than some arbitrary point that the checkerboard was located at. I have found this thread: https://stackoverflow.com/questions/12283501/how-to-calculate-extrinsic-parameters-of-one-camera-relative-to-the-second-camer?rq=1 but doing so, I'm not getting the correct result. – user3178756 Apr 08 '18 at 17:19
  • @user3178756 unless you are doing something very specific that I dont understand, no, its not easier at all to do it with one cameras world coordinate. Not that is harder either, but not easier, and you are introducing an unecessary extra step – Ander Biguri Apr 08 '18 at 20:26
  • @AnderBiguri that's true, for now, I am just trying to learn and understand these transformations – user3178756 Apr 10 '18 at 09:55

1 Answers1

1

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.

Francesco Callari
  • 11,300
  • 2
  • 25
  • 40