Determination of stereo camera world coordinates with respect to calibration target
Show older comments
I'm having some issues getting a precise and accurate determination of the location of my cameras. I am defining my world coordinate system with the origin on the calibration target, and want to know the world coordinates of the camera centers relative to this. I take a set of ~20 images, calibrate the cameras using the stereo calibration functions, and then compute the camera centers as:
wocoIdx= 1; % index for the image with the calibration target located where I would like to define my world coordinate system
C1= -stereoParams.CameraParameters1.TranslationVectors(wocoIdx,:);
C2= -stereoParams.CameraParameters2.TranslationVectors(wocoIdx,:);
The issue is that this typically gives me cameras spaced ~111mm apart horizontally, versus the 140mm I have measured manually.
(1) Is camera height vs. camera spacing a limiting factor here? My cameras are about 1960mm from the world coordinate target and spaced ~140mm apart. When calibrating, I translate the calibration target in a range of 200mm towards/away from the camera (this is limited by the depth of field of the setup).
(2) Am I missing another step (rotation?) to obtain the camera centers? I've also tried using the triangulate function but had little success getting an accurate estimate. The approach I used with triangulate is:
undistortedImagePts1= undistortPoints(imagePoints(:,:,wocoIdx,1),stereoParams.CameraParameters1);
undistortedImagePts2= undistortPoints(imagePoints(:,:,wocoIdx,2),stereoParams.CameraParameters2);
C1= triangulate(undistortedImagePts1(1,:),undistortedImagePts2(1,:),stereoParams);
C2= C1 + stereoParams.TranslationOfCamera2';
Accepted Answer
More Answers (1)
Am I missing another step (rotation?) to obtain the camera centers?
I think so. The camera center is the null vector of the 3x4 camera matrix or, in non-homogenous coordinates, the center C is given by
C=-R.'*t
where R is the camera rotation matrix and t is the translation vector from the camera extrinsic parameters. It looks like you are interpreting t to be the camera center.
7 Comments
Did you do anything to verify the success of the calibration? When you compose the camera matrices and apply them to sets of world coordinates (e.g., the origin) do the world coordinates project onto the appropriate 2D coordinates in the camera images?
Tracy
on 20 Jul 2015
Matt J
on 20 Jul 2015
Hmmm. Then, I guess my next question would be how you did the manual measurement (the one which gave you 140 mm separation). In my (limited) experience, the physical location of the camera center isn't something that's very easy to know in advance. I believe it might not even necessarily be located within the physical shell of the camera.
Tracy
on 20 Jul 2015
Another suggestion would be to try the calibration again with the cameras at a smaller depth from the calibration target. I've heard speculation that the decomposition of a camera into extrinsic and intrinsic parameters becomes more ill-posed at large depths. If a smaller depth gives you better accuracy, it could at least tell you whether the camera centers are located in the physical bodies of the camera.
Tracy
on 21 Jul 2015
Categories
Find more on Camera Calibration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!