Ask Your Question

Left and Right camera according to ROS/OpenCV

asked 2018-02-26 14:08:01 -0500

malharjajoo gravatar image

updated 2018-02-26 14:08:17 -0500


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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-02-26 15:35:03 -0500

Thomas D gravatar image

updated 2018-02-28 13:05:24 -0500

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

edit flag offensive delete link 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).

malharjajoo gravatar imagemalharjajoo ( 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.

malharjajoo gravatar imagemalharjajoo ( 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().

malharjajoo gravatar imagemalharjajoo ( 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

Thomas D gravatar imageThomas D ( 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.

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

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

malharjajoo gravatar imagemalharjajoo ( 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!

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-02-26 14:08:01 -0500

Seen: 356 times

Last updated: Feb 28 '18