ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Mono16 images displayed as 8 bits in rostopic echo

asked 2016-02-22 05:27:54 -0600

Thomas Guerneve gravatar image

Hi there !

I generate a 16bits image (stored in an opencv CV_16U) that I convert to a msg using cv_bridge with the right encoding (mono16). When I do a rostopic echo on the image topic, I get this kind of output :

header: seq: 481 stamp: secs: 1456138732 nsecs: 716579801 frame_id: '' height: 250 width: 1 encoding: mono16 is_bigendian: 0 step: 2 data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 7, 0, 7, 0, 9, 0, 9, 0, 7, 0, 9, 0, 7, 0, 9, 0, 9, 0, 9, 0, 7, 0, 11, 0, 7, 0, 9, 0, 11, 0, 9, 0, 9, 0, 9, 0, 13, 0, 9, 0, 11, 0, 11, 0, 9, 0, 11, 0, 11, 0, 11, 0, 13, 0, 11, 0, 11, 0, 13, 0, 11, 0, 13, 0, 13, 0, 13, 0, 11, 0, 13, 0, 14, 0, 13, 0, 13, 0, 14, 0, 14, 0, 13, 0, 16, 0, 14, 0, 14, 0, 16, 0, 14, 0, 16, 0, 14, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ...

(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-02-22 05:59:10 -0600

dornhege gravatar image

This is just the encoding of the image data as a byte array. I would assume you'll find twice the byte entries here than you have image pixels. You just have to interpret two bytes as a 16-bit pixel.

edit flag offensive delete link more

Comments

Absolutely, as I said I can read the image and use it without any issue, but it should be displayed properly in rostopic echo, it's handy for debugging...

Thomas Guerneve gravatar image Thomas Guerneve  ( 2016-02-24 04:44:53 -0600 )edit
1

It is displayed correctly in rostopic - in the sense that rostopic shows you, what exactly is send as the message. What you are looking for is a semantic interpretation of messages. rostopic cannot do that as it would need to know how to interpret any message. It's also the tool to show raw data.

dornhege gravatar image dornhege  ( 2016-02-24 07:05:33 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-02-22 05:27:54 -0600

Seen: 1,327 times

Last updated: Feb 22 '16