Robotics StackExchange | Archived questions

ROS stereo disparity issues

Im having issues getting a stereo disparity image to work with the PS4EYE

this is what I am getting from the camera. the left and right cameras seem to be working, but disparity is way off. Even when I point it at a person. how do I fix this? I'm using the PS4EYE node from longjie.

Screenshot from 2015-05-29 231501.png

EDIT: Looks like its in the parameters, but I have no idea what values I should change to make it look right.

Asked by Fullmetal99012 on 2015-05-30 15:06:29 UTC

Comments

Did you calibrate the cameras using stereo_calibration? Also, what parameters are you using? A min_disparity (lower values allow you to see further) of 0 and disparity range of 64 seem to work for me. Also mess with texture threshold to remove noise. 500 worked well for me on that param.

Asked by frankb on 2015-05-31 01:53:36 UTC

looks like I forgot to calibrate. Will do that when I get back to the lab

Asked by Fullmetal99012 on 2015-06-01 16:31:20 UTC

Answers

Hi,

It seems that your cameras are not calibrated properly. any stereo matching code assumes that epi-polar lines are horizontal in left and right images. which means that if you take any point in the left(u,v) image, the corresponding point should lie on the same row i.e., (u1,v). To make sure that this happen, you need to calibrate the cameras, once you calibrate them, you will get these parameters M1,M2(camera matrix) R,T,P1,P2(projection matrix) etc. From these params you will need to rectify the input images using image_proc.

If you have already done the calibration, redo it again, and make sure that your calibration and rectification is accurate. If calibration/rectification fails again then use OpenCV's calibration procedure,(It produces a bit different results than ROS).

To check the rectification, just save rectified images and run SIFT matching code on stereo pairs, plot the lines between two images and these line should come strait and perfectly horizontal. Links, 1. ROS calibration : wiki.ros.org/camera_calibration 2. Opencv calibration : http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html 3. plot sIFT : http://www.mathworks.com/matlabcentral/fileexchange/30849-image-mosaic-using-sift/content/siftMatch.m

Tell me in case of any doubt.

Hope I helped Sudeep

Asked by Sudeep on 2015-06-01 00:44:22 UTC

Comments

ah. yeah I completely forgot to calibrate it.

When I get the calibration values, and convert them to the .yaml, where do I pass in the parameters? since this is a stereo camera, are they passed into stereo_image_proc?

Asked by Fullmetal99012 on 2015-06-01 16:30:50 UTC

Hi, Publish them under your namespace as /(your_nameSpace)/left/camera_info and (namespace)/right/camera_info as camera_info msgs link

Asked by Sudeep on 2015-06-03 04:21:55 UTC