ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Left and Right camera according to ROS/OpenCV

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

malharjajoo gravatar image

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

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

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

Thomas D gravatar image

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

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

Comments

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 image malharjajoo  ( 2018-02-26 17:44:12 -0600 )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 image malharjajoo  ( 2018-02-26 17:50:59 -0600 )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 image malharjajoo  ( 2018-02-26 17:51:21 -0600 )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 image Thomas D  ( 2018-02-26 20:17:51 -0600 )edit

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

malharjajoo gravatar image malharjajoo  ( 2018-02-27 00:31:39 -0600 )edit

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

malharjajoo gravatar image malharjajoo  ( 2018-02-28 12:40:02 -0600 )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 image malharjajoo  ( 2018-02-28 17:00:42 -0600 )edit

Question Tools

2 followers

Stats

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

Seen: 1,694 times

Last updated: Feb 28 '18