0

Rosanswers logo

HI,

I am currently trying to calibrate 2 cameras (stereo calibration) and tried using this tutorial.

Question: What is the Translation (and Rotation) vector in the output of the calibration ? Is it the transform required to move left camera coordinate system to right ?

What I dont understand: The tutorial mentions left and right camera, but are these left and right wrt to user ? (can be opposite since user is facing the cameras).

On digging deeper into openCV docs , I came across this image. It clearly suggests that the camera to the right of the user (facing cameras) is the left camera. However my results from stereo calibration dont make sense then. Can someone please explain which is the left camera ??

image description


Originally posted by malharjajoo on ROS Answers with karma: 121 on 2018-02-26

Post score: 0

CC BY-SA 3.0

1 Answer 1

0

Rosanswers logo

Update from comments by @malharjajoo:

Camera info parameters are described and illustrated at that link.

You can see some illustrations at stereo_image_proc that show left and right are with respect to the cameras, not to any external reference frame such as an observer.

From OpenCV the projection matrices are P1 and P2 as described in cv::stereoRectify(), P = [K | [Tx 0 0]'.


Originally posted by Thomas D with karma: 4347 on 2018-02-26

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by malharjajoo on 2018-02-26:
Hi, thanks a lot for answering... I'd like to point out, from the same openCV docs, the cv::stereoRectify() function mentions that P2 (for right camera) 4th coloumn contains by Tx * f (not Tx).

Comment by malharjajoo on 2018-02-26:
regardless of the scaled value, this Translation is negative. How is that correct ? shouldnt the right camera be positively translated since openCVs coordinate system has postive x-axis to the right.

Comment by malharjajoo on 2018-02-26:
I think rectification matrix given as output on camera calibration is the R1 and R2 from OpenCV docs. Hence rotation is not part of P1 and P2 ( P is not R | t , but instead K | [ Tx 0 0 ]' as indicated in cv:stereoRectify().

Comment by Thomas D on 2018-02-26:
P1 and P2 do seem to be described in cv::stereoRectify. Since the right camera has the x-axis pointing to the right you have to translate along the negative x axis to get to the left camera

Comment by malharjajoo on 2018-02-27:
ok yeah, that makes sense. For some reason I was assuming the transform provided were from left to right coordinate system.

Comment by malharjajoo on 2018-02-28:
Hi, I have found a reference in the ROS wiki :D ! - See last para

Comment by malharjajoo on 2018-02-28:
Also, @Thomas D, thanks for your help. Although a bit unrelated, I have been able to obtain a point cloud image using the stereo_image_proc using 2 cheap webcams. The point cloud gets very bad if the cameras are interchanged and hence this post helped me in that way too :D. cheers!

CC BY-SA 3.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.