Extract image with Rosbag API
Hello everyone. My intention is to extract numerous sensor_msgs from a .bag file (IMU, Velodyne, Image, GPS).
When I looked for a bag extractor I saw many packages (image_view extract_images) or methods (to extract data into a CSV) but no method for specific formating. I looked into the Rosbag API (in C++) and managed to extract data to a .txt or binary files.
However, my images are compressed and the recommended nodes are extract_images from image_view and republish from image_transport which use publisher/subscriber principle (same as in this example).
¿Is there any reason for not using the rosbag API to extract images from a bag? ¿Is there any easy way to decompress images without using the image_transport package?
So far I came across this answer, but ¿can anyone confirms me if cv::imdecode is enough as a substitution for image_transport? ¿Would it be the same application as the compressed_subscriber or am I missing something?
Thank you in advance for your help! :)
Thank you for your answer. I was unaware that toCvCopy accepted a compressed image as input. However, this answer also confirms that I was not in the wrong direction.