Ask Your Question

Revision history [back]

The answer you linked to is from a very long time ago and attempts to manually build up the ROS image message manually, although this can be done it isn't anything I'd recommend.

You can use the cv_bridge package to produce ROS image messages from CV images and vice versa. This package will take care of various encodings for you including mono16 and 32FC1 which you mentioned and includes a python example very similar to what you're trying to do. You will have to construct Open CV images using cv::Mat objects if you're not doing that already.

Hope this helps.