Decode compressedDepth message from compressed_depth_image_transport
Hi,
I am using the compressed_depth_image_transport
to compress a Kinect depth image before letting it go through rosbridge
(the client won't have ROS or opencv installed, only pip-installed libs). The image is float32 compressed in png.
On the client, I receive the image encoded in base64 by rosbridge
. After decoding the base64 string, what I have is bytes that are supposed to be the compressed image. However, I cannot figure out the format of the image. For instance, if I wrtite directly the bytes to a ".png" file, I cannot open it using an image viewer. I also get exceptions if I try to load the bytes using Pillow, pypng, scipy, etc.
How does compressed_depth_image_transport
works? I have seen in the source code that it uses cv::imencode
, does it produce a valid png file content as I expect?
Thank you!