ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
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 recording 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>
2 | No.2 Revision |
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 recording 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>