What is the exact format and size of Image() object?
I cannot figure out what is the exact format of the sensor_msg Image() file. When I issue the command:
rostopic echo /camera/image_raw
I get a massive output consisting of thousands of numbers in an array. However, when I look up the documentation, there is supposed to be a heading, height, width, etc and the actual data. I have never been able to find the header or any other parameter from the output. I also cannot figure out just how large the file is. This makes it difficult to manipulate and transport the data. Can someone please help me out?
The
rostopic --help
output may offer some guidance here:if you add
--noarr
to yourrostopic echo
command, you'll be able to see the header and other non-array fields.probably a typo, but there is a
header
field. Notheading
.A general usability suggestion: if you can accept the OpenCV dependency, try to consume
sensor_msgs/Image
messages using image_transport subscribers and convert messages to their OpenCV representation. That will make it much easier to work with them.Working directly with the serialised form (in the form of
sensor_msgs/Image
) might not be the most efficient (from a usability perspective).