Convert ROS DisparityImage msg with image encoding 32FC1 into openCV Mat using cv_bridge

asked 2017-03-23 23:46:45 -0600

2ROS0 gravatar image

updated 2017-03-24 10:01:46 -0600


I have a ROS DisparityImage msg which has an encoding of 32FC1. I would like to convert this into an openCV mat. However, the toCvCopy function from cv_bridge doesn't seem to account for that encoding. It only supports MONO and BGR/RGB/BGRA/RGBA.

How do I interpret the data[] field of sensor_msgs/Image in stereo_msgs/DisparityImage to convert this floating point representation into MONO values?

Thank you.

edit retag flag offensive close merge delete