[ros-users] How to encode mono16 data in Image messages?
jack.oquin at gmail.com
Mon May 31 17:04:39 UTC 2010
I am trying to get the "*_mono16" video modes working with camera1394.
If I just copy the two-byte pixels, image_view of camera_raw fails
with an opencv exception. I can't tell if this is a bug in the camera
driver or in image_view.
I've looked at docs and code, but I'm still not clear how 16-bit
monochrome image data should be encoded. The two-byte per pixel copy
is modeled on cameradc1394. Is this snippet of code wrong?
image_size = image.height*image.step;
image.encoding = enc::MONO16;
memcpy(&image.data, capture_buffer, image_size);
Could this be a little-endian problem?
More information about the ros-users