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

Depth image from a Disparity image

asked 2014-05-16 07:53:51 -0500

vvaquero gravatar image

Hi there,

I am using a Bumblebee2 stereo camera, and with the "stereo_image_proc" node, I am able to get the disparity image of the scene, as well as the point cloud...

But It would be more useful for me to have a normal grey-scale image. I know it is straightforward to get it from the disparity information, just applying the formula Z(depth) = T*f (camera parameters) / d (disparity), but I guess there should be another done performing this as well as the interpolation of the "NaN", "0", or "inf" pixels of the disparity image...

Any help? I've been looking around but couldn't find any.


edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted

answered 2014-05-19 00:51:10 -0500

updated 2014-05-20 22:11:41 -0500

I faced the same problem and implemented a conversion nodelet based on the pointcloud2 nodelet in stereo_image_proc. The whole thing isn´t very polished (it´s still subscribing to the left camera image, although it wouldn´t have to for example) but it generates depth images as needed. See here on github and this example launch file.

/edit: Also created issue 71 at image_pipeline github on the topic.

edit flag offensive delete link more


How do you run your package Stefan please ? I got an error and a Fatal error when i tried to use it. Thank

lilouch gravatar image lilouch  ( 2015-04-07 01:46:04 -0500 )edit

Hi, Stefan. I'm using your disparity_image_proc package to convert disparity image from stereo camera to depth image. Unfortunately depth image topic has no messages. I've posted the issue on the github, if you have time could you please give a hint on what possibly be wrong

Wintermute gravatar image Wintermute  ( 2018-10-04 09:44:25 -0500 )edit

answered 2014-05-16 15:40:46 -0500

Hi, As you are looking for the depth of each point you can use nodelets of package stereo_image_proc, It computes point cloud2 and point cloud, using these data depth of each point can be obtained (Look for PCL examples for this).

Link : Look at the point 5.2/5.3 : stereo_image_proc/point_cloud2 here


edit flag offensive delete link more

answered 2014-05-20 05:43:14 -0500

vvaquero gravatar image

Thank you both!!

although I am not used to use nodelets, I manage to do the remapping on your launch, Stefan, and is now working. I will try now to get a better depth image!

edit flag offensive delete link more

Question Tools



Asked: 2014-05-16 07:53:51 -0500

Seen: 5,252 times

Last updated: May 20 '14