0
$\begingroup$

Rosanswers logo

Using an RGBD camera (RealSense D435), we want to log compressed color images (JPEG 'compressed'), and depth images (PNG 'compressedDepth'). The realsense driver publishes these compressed topics which is great.

However the problem comes in processing the two types data: Image transport gives some tutorials on how to subscribe to a compressed topic using a single param 'image_transport compressed'

But these two topics are of a different type, so we cannot set a single 'image_transport' variable to compressed or compressedDepth.

Question: Can a single application use image_transport to subscribe to both a compressed JPEG topic and a compressedDepth PNG topic. This is needed to be able to run Visual Odometry on this data.


Originally posted by mozer on ROS Answers with karma: 3 on 2018-07-17

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

I am not sure but I think that image_transport should be able to allow you to subscribe to different topics with different data types. Take a look into compressed_image_transport and compressed_depth_image_transport. They both refer to this tutorial. Its a bit vague, but you should have two different parameters(<base_topic>/compressed/format (string, default: jpeg)). Compressed color images should be on /camera/rgb/image_raw/compressed and compressed depth images on /camera/depth/image_raw/compressed. You should be able to change the format (jpeg or png) for them separately. You can check for the color images if you echo this /camera/rgb/image_raw/compressed/parameter_updates for example.

Also this link might help you with another way of setting the compressed parameter.


Originally posted by pavel92 with karma: 1655 on 2018-07-18

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

From what I understand from your question is that you are recording bags with compressed image topics and need to do some processing on the recorded images. If you want you can build the decompression into your image processing node, you can google for examples or look at the image_transport API. It is unclear to me what the problem there is, adding the second topic to your code that handles one topic?

I'm not sure what it is exactly you are asking, so I will answer a question that I think you have. How do I get decompressed images that I can process from a bag of compressed data?

Make a launch file to decompress the data using republish(change the "your_*_topic" to the actual topics you want to decompress):

<launch>
    <node name="decompress_jpg" pkg="image_transport" type="republish" output="screen"
        args="compressed in:=/your_jpg_topic raw out:=/your_jpg_topic_raw">
    </node>

    <node name="decompress_png" pkg="image_transport" type="republish" output="screen"
        args="compressed in:=/your_png_topic raw out:=/your_png_topic_raw">
    </node>
</launch>

To diplay the images you could make another launch file like this

<launch>
   <node name="image_view_jpg" pkg="image_view" type="image_view" respawn="false" output="screen">
        <remap from="image" to="/your_jpg_topic_raw" />
    </node>

    <node name="image_view_png" pkg="image_view" type="image_view" respawn="false" output="screen">
        <remap from="image" to="/your_png_topic_raw" />
    </node>
</launch>

Originally posted by Reamees with karma: 591 on 2018-07-18

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.