Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There is a problem about stereo calibration. Based on the rosbag of the outdoor stereo demo here, the rectified images and disparity images (outputs of stereo_image_proc) should look more like this:

$ rosrun image_view stereo_view stereo:=stereo_camera image:=image_rect_color

image description

Look how dense is the disparity image. The following are the raw images (there are some distortions: lines are not straight like the rectified above) and camera_info used as inputs to stereo_image_proc:

image description

Left camera_info:

header: 
  seq: 844
  stamp: 
    secs: 1415737755
    nsecs: 627326965
  frame_id: stereo_camera
height: 480
width: 640
distortion_model: plumb_bob
D: [-0.344858300062205, 0.131731614744127, -0.00032220157418798, -0.000178643627395838, 0.0]
K: [520.84106910681, 0.0, 320.207922533597, 0.0, 520.652683004955, 251.69140630101, 0.0, 0.0, 1.0]
R: [0.999977409119708, -0.00542294021453702, -0.00397151981806852, 0.00542696944573559, 0.999984769417176, 0.00100445821860056, 0.00396601221263954, -0.00102598884371095, 0.999991609011807]
P: [487.608731712861, 0.0, 318.1162109375, 0.0, 0.0, 487.608731712861, 249.44425201416, 0.0, 0.0, 0.0, 1.0, 0.0]
binning_x: 1
binning_y: 1
roi: 
  x_offset: 0
  y_offset: 0
  height: 480
  width: 640
  do_rectify: False

Right camera_info:

header: 
  seq: 844
  stamp: 
    secs: 1415737755
    nsecs: 627326965
  frame_id: stereo_camera
height: 480
width: 640
distortion_model: plumb_bob
D: [-0.350198880846778, 0.143262162037345, -0.000540958577710845, -0.000386869942974346, 0.0]
K: [525.042672813, 0.0, 315.778978739153, 0.0, 524.605377865008, 246.116481979902, 0.0, 0.0, 1.0]
R: [0.999991166299663, -0.00384047779504094, 0.00170823094047773, 0.00384221006573169, 0.999992106658553, -0.00101194980141688, -0.0017043310860856, 0.0010185042442697, 0.999998028950384]
P: [487.608731712861, 0.0, 318.1162109375, -58.3626989865376, 0.0, 487.608731712861, 249.44425201416, 0.0, 0.0, 0.0, 1.0, 0.0]
binning_x: 1
binning_y: 1
roi: 
  x_offset: 0
  y_offset: 0
  height: 480
  width: 640
  do_rectify: False

I thus recommend to carefully follow the stereo calibration tutorial to get similar results like above with a dense disparity image. Make sure your camera driver publishes the camera_info created from the stereo calibration so that stereo_img_proc can correctly rectify the raw images. Without that dense disparity image, you won't be able to create a 3D map as rtabmap is using the same algorithm (cv::StereoBM) than stereo_img_proc to create the disparity image used to create the clouds.