ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org

# Left and Right camera according to ROS/OpenCV

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 ??

edit retag close merge delete

Sort by ยป oldest newest most voted

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]'.

more

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).

( 2018-02-26 17:44:12 -0500 )edit

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.

( 2018-02-26 17:50:59 -0500 )edit

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().

( 2018-02-26 17:51:21 -0500 )edit

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

( 2018-02-26 20:17:51 -0500 )edit

ok yeah, that makes sense. For some reason I was assuming the transform provided were from left to right coordinate system.

( 2018-02-27 00:31:39 -0500 )edit

Hi, I have found a reference in the ROS wiki :D ! - See last para

( 2018-02-28 12:40:02 -0500 )edit

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!

( 2018-02-28 17:00:42 -0500 )edit