What are the difference between rgb and greyscale images in the image msg Data vector?

asked 2018-02-22 04:16:33 -0600

Mondo gravatar image

Hi everyone,

I'm trying to convert with another program the ROS image msg to an OpenCV matrix. The image source is a multi camera plugin in Gazebo: "libgazebo_ros_multicamera.so". I've been able to convert correctly a RGB (R8G8B8 image format) image with size 640x480, in this case I get a value of 921600 image msg Data length . However, if I switch to GREYSCALE (L8 image format) keeping the same dimensions I get the same value of 921600 image msg Data length and a wrong conversion. Can someone please help me in understanding why the Data vector size is the same? What are the differences between a RBG image and a Greyscale image in the Data vector?

Thanks in advance.

edit retag flag offensive close merge delete