ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

depth_image_proc for TYPE_8UC1 stereo images

asked 2018-03-20 02:46:35 -0600

Jerzy97 gravatar image

Hi there,

I found this cool package to process a disparity map, I got from a stereo camera pair, and compute a point_cloud:

Here is my problem: The stereo pair has its own FPGA and readily outputs a disparity map of type sensor_msgs::Image with image encoding MONO8. I would like to use the above package, in particular this nodelet , to compute a sensor_msgs:PoitCloud2 message from that. However the package only provides templates for image encodings: TYPE_16UC1 or TYPE_32FC1 (as mentioned in Line 117 and 121 of the nodelet).

I found a way to convert from MONO8 to TYPE_16UC1 so I can use the above nodelet, however I do not think this is a very elegant or efficient solution. I would rather add the possibility to process TYPE_8UC1 images with the nodelet (Conversion from MONO8 to 8UC1 should be less expensive, right?). I think I have to add a template for "uint8_t" in this file

Unfortunately, I have a very poor understanding of image encodings etc. and I am not sure what exactly I would need to add. Could somebody give me a hint on how to do that, or point me to some recourses, where I could find out? Or do you have better suggestions to solve my problem?

I am using ROS Indigo on Ubuntu 14.04

Really appreciate your answers :)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-20 05:12:52 -0600

tuandl gravatar image

To my understanding, I think there is a confusion in your stereo camera's driver. Mono8 is a color encoding, which contains one 8-bit monochromatic channel. TYPE_16UC1 in depth_image_proc is a type of unsigned 16-bit depth channel. So basically, these are 2 different things.

IMO, your proposal to convert from Mono8 to TYPE_8UC1/TYPE_16UC1 doesn't really make sense. My suggestion is that you change your camera's driver to output correct encoding.

AFAIK, TYPE_16UC1 in depth_image_proc gives you values in millimeter unit, while TYPE_32UC1 returns meter unit.

edit flag offensive delete link more


Thanks a lot! I was able to change that and now I am getting the point cloud.

Jerzy97 gravatar image Jerzy97  ( 2018-03-20 13:02:12 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-03-20 02:46:35 -0600

Seen: 244 times

Last updated: Mar 20 '18