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

Stereo triangulation of points

asked 2014-06-30 08:21:46 -0500

zbuffer gravatar image

Hello!

I need to reconstruct 3d position of a tennis ball by using a stereo camera. I am detecting the ball center positons in the rectified images and pass them to the cv::triangulatePoints(P1, P2, points1, points2, points_out). For the P matrices I use the ones obtained from the camera_info of both cameras. The reconstructed 3d position is not correct - it moves a lot when the camera is rotated or moved. It looks ok only when the ball is close to the center of the images. I use the same code for a simulated stereo camera which has no distortion and it works properly so the error is somewhere in the projectiom matrices or detected center coordinates for the real images. I have compared the matrices in the camera_info when using the simulation and the real camera and they seem ok (the baseline is correct and the rotations also).

There is one thing I have noticed when comparing the images before and after rectification - the image is cropped and resized to the full frame dimensions (done automatically by ROS).

Is it properly reflected in the matrices of the camera_info message?

If not, I suppose I have to modify the detected ball center to get the position before the crop/resize?

Can I get the image without the crop/resize? How to do it?

Maybe there is some other problem?

Best, Patryk

edit retag flag offensive close merge delete

Comments

Have you checked if there is a difference between the camera_info message of the rectified image and the original one? This would at least tell you, whether they are adapted at all.

Felix Endres gravatar image Felix Endres  ( 2014-06-30 11:07:47 -0500 )edit

Have you taken a look at the arToolkit package?

l0g1x gravatar image l0g1x  ( 2014-10-13 10:36:40 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-10-04 21:41:12 -0500

tfoote gravatar image

Usually there are both topics image_raw and image_rectified

edit flag offensive delete link more
0

answered 2014-10-07 15:47:41 -0500

benabruzzo gravatar image

I think it would be nearly impossible to get anything useful from the two images before they are rectified. You might want to look at the output from the calibration files, check to see if inv(K)*P yields a rotation matrix, that will at least key you in as to whether or not your calibration may have issues.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-06-30 08:21:46 -0500

Seen: 1,161 times

Last updated: Oct 07 '14