Items with no label
3335 Discussions

Realsense-ROS: Decompressing compressedImages to get original 16UC1 byte representation

ACast36
Beginner
2,858 Views

Hi,

I am using Realsense-ROS's published topic "'/camera/aligned_depth_to_color/image_raw/compressed". It is jpeg compressed and originally was 16UC1.

 

I then want to decompress this compressedImage for using in Unity.

 

For this, I use OpenCV's imdecode function with flag 'CV_LOAD_IMAGE_ANYDEPTH'. Instead of getting the original 16UC1 representation back, I am receiving a 8UC1 representation.

 

So my question is , is it possible to decompress the compressedImage pulished by the "'/camera/aligned_depth_to_color/image_raw/compressed" topic back to 16UC1 ?

 

0 Kudos
1 Reply
MartyG
Honored Contributor III
2,135 Views

I should first provide the disclaimer that my knowledge of ROS programming is not advanced, but I will do my best to assist!

 

Another person who asked about decompressing the image had two approaches suggested to them:

 

1. Use a ROS plugin called compressed_image_transport.

 

http://wiki.ros.org/compressed_image_transport

 

2. Convert the ROS messages to an OpenCV image using the cv_bridge package.

 

http://wiki.ros.org/cv_bridge

 

The full discussion can be found at the link below:

 

https://answers.ros.org/question/276352/how-to-understand-data-from-the-image_rawcompressed-topic/

 

0 Kudos
Reply