Generating a 8UC4 image message

asked 2021-07-27 07:35:18 -0600

Kansai gravatar image

updated 2021-07-27 07:35:33 -0600

As one of the requirements of the system I am working on, the client has asked me to generate a 8UC4 image message (and publish it)

I am reading the tutorial on using Cv_bridge and I have when converting from OpenCV images to image messages that

cv2_to_imgmsg() does not do any conversions for you (use CvtColor and ConvertScale instead). . The ROS image message must always have the same number of channels and pixel depth as the cv::Mat.

So, does this mean that I have to actually generate a 8 bit unsigned 4-channel cv::Mat first and then using cv2_to_imgmsg convert it to a message rather than trying to operate on the message.

Am I getting the things right?

edit retag flag offensive close merge delete