Search code examples
computer-visioncamera-calibrationcalibrationrotational-matricesextrinsic-parameters

How to calculate extrinsic parameters of one camera relative to the second camera?


I have calibrated 2 cameras with respect to some world coordinate system. I know rotation matrix and translation vector for each of them relative to the world frame. From these matrices how to calculate rotation matrix and translation vector of one camera with respect to the other??

Any help or suggestion please. Thanks!


Solution

  • First convert your rotation matrix into a rotation vector. Now you have 2 3d vectors for each camera, call them A1,A2,B1,B2. You have all 4 of them with respect to some origin O. The rule you need is

    A relative to B = (A relative to O)- (B relative to O)
    

    Apply that rule to your 2 vectors and you will have their pose relative to one another.

    Some documentation on converting from rotation matrix to euler angles can be found here as well as many other places. If you are using openCV you can just use Rodrigues. Here is some matlab/octave code I found.