image_pipeline
image_pipeline copied to clipboard
Generating depth images via stereo_image_proc
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.
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.
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?
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
+1
@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?
I'll have a look thanks!
Voila:

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