How to determine pose of 3 cameras as two stereo pairs?

10 views (last 30 days)
I have 3 cameras that I have calibrated as pairs (1-2 & 2-3) with camera 2 in common. I am using the stereo camera calibration script generated from the toolbox.
Does anyone know how I can transform translations and rotations of the 3rd camera so that its pose is in the coordinate system of the 1st camera. The first calibration (1-2) gives me the translation and rotation of camera 2 wrt to camera 1, and the second gives me 3 wrt 2.
This is the way I have been doing it but when I plot the poses it doesn't look right - camera three seems to be in the wrong position.
  • For rotations I've simply multiplied the two rotation matrices - C3R
  • For translations I've contructed a homogeneous transormation matrix and then extracted the translation elements - C3T
Any know how to solve this one?
%Camera 2 Tranforms
C2T=stereoParams12.TranslationOfCamera2; %translation of 2 wrt 1
C2R=stereoParams12.RotationOfCamera2; %rotation of 2 wrt 1
C2=[C2R(1,1) C2R(1,2) C2R(1,3) C2T(1,1);C2R(2,1) C2R(2,2) C2R(2,3) C2T(1,2);C2R(3,1) C2R(3,2) C2R(3,3) C2T(1,3);0 0 0 1];
%Camera 3 Transforms
C3Rot=stereoParams23.RotationOfCamera2; %rotation of 3 wrt 2
C3Tra=stereoParams23.TranslationOfCamera2; %translation of 3 wrt 2
C3=[C3Rot(1,1) C3Rot(1,2) C3Rot(1,3) C3Tra(1,1);C3Rot(2,1) C3Rot(2,2) C3Rot(2,3) C3Tra(1,2);C3Rot(3,1) C3Rot(3,2) C3Rot(3,3) C3Tra(1,3);0 0 0 1];
C3Hom=C2*C3; %homogeneous transformation matrix
C3T=[C3Hom(1,4) C3Hom(2,4) C3Hom(3,4)]; %translation of 3 wrt 1
C3R=C2R*C3Rot; %rotation of 3 wrt 1
% stereoParams12: Calibration of cameras 1&2
% stereoParams23: Calibration of cameras 2&3
Any help would be much appreciated!
Thanks in advance,
Cameron
  2 Comments
John D'Errico
John D'Errico on 5 Sep 2019
Edited: John D'Errico on 5 Sep 2019
I lack the appropriate toolbox to know, nor do I have expertise in this particular field. (I'd have made this an answer if I did.)
But it seems to me that you need to be careful with the translation of camera 3. You know the translation of 3 wrt 2, but that translation is described in the coordinate system of camera 2. That leaves you with a disconnect, because you want it all in the camera 1 coordinate system. So you need to back the 2-->3 translation through the camera 2 rotation from 1 to 2.
Logically, it might be better if you did everything with respect to camera 2 anyway, as the camera in common. Then you don't need to back things up to camera 1.
An alternative approach is to pair camera 1 and 2, then camera 1 and 3. That leaves camera 1 as the common camera, so it is much simpler to unravel things.
Just some vague thoughts, that might be helpful.
Cameron Swanson
Cameron Swanson on 5 Sep 2019
Hi John,
Thanks for your response!
I perhaps should have said in my post that I'd evenetually like to extend this to 3+ cameras, and while the points you make seem like a much more logical approach, I don't know how this would work when scaling up. I think for 3 cameras, as you suggest using camera 2 as the reference makes absolute sense.
The other approach seems like a good option too but my worry again when scaling up would be small FoV overlap. Something else to try out!
Thanks

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB Support Package for USB Webcams in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!