image_pipeline icon indicating copy to clipboard operation
image_pipeline copied to clipboard

Generating depth images via stereo_image_proc

Open skohlbr opened this issue 11 years ago • 7 comments

As also asked occassionally on ROS Answers, it is not possible to generate depth images as per REP118 easily using stereo_image_proc, as the standard nodelets either produce a disparity image or a PointCloud2, but not the "intermediate" depth image that has been standardized in REP118. I implemented a very basic nodelet for this based on the existing point_cloud2 nodelet here and would polish it a bit and create a pull request for adding it to stereo_image_proc unless there´s some problem with that idea.

skohlbr avatar May 19 '14 11:05 skohlbr

I believe in would make more sense to add a PR to image_geometry about that. Just call reprojectimageto3d and then copy the third channel. Then a PR here makese sense too but it should use that API.

vrabaud avatar May 19 '14 14:05 vrabaud

Since you get the DisparityImageConstPtr in the callback, would it make sense to call model_.getZ(d) for each pixel d in the disparity image instead of going through an intermediary pointcloud?

lucasb-eyer avatar Oct 30 '14 16:10 lucasb-eyer

Hello. Sorry to bump a very old issue, but I'm currently working on the same problem, I already have stereo camera working and stereo_image_proc provides a disparity image. But for my project I need a depth image. From what I understand it can be calculated using following formula depth = baseline * focallength / disparity

AIWintermuteAI avatar Oct 04 '18 15:10 AIWintermuteAI

+1

ToniRV avatar Mar 15 '20 05:03 ToniRV

@ToniRV https://github.com/skohlbr/disparity_image_proc I remember in the end I was successful using this old package(Kinectic, Ubuntu 16.04). It took me quite a long while to get the settings right. Spent 20 minutes looking for this package on Github xD Fortunately I created an issue in that repo, that is how I was able to find it. https://github.com/skohlbr/disparity_image_proc/issues/2 The trick is in right configuration. Good luck! If you do manage to get it to work, can you post a working solution?

AIWintermuteAI avatar Mar 16 '20 06:03 AIWintermuteAI

I'll have a look thanks!

ToniRV avatar Mar 23 '20 15:03 ToniRV

Voila: image

Everything was there already thanks to @skohlbr I enumerated my changes here https://github.com/skohlbr/disparity_image_proc/issues/2

ToniRV avatar Mar 23 '20 16:03 ToniRV