ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

How to I rosbag/record a loosless compressed images

asked 2014-02-13 23:58:56 -0600

Markus Bader gravatar image

Hi

I like to record raw images using rosbag.

rosbag record /front_camera/image_raw

Works perfect and I can view the images with

rosbag play my_bag.bag &
rosrun image_view image_view /front_camera/image_raw

But the bag files becomes get big very fast

My question is now is there a way to record images loosless compressed? Currently I see the following topics

/front_camera/image_raw
/front_camera/image_raw/compressed
/front_camera/image_raw/compressed/parameter_descriptions
/front_camera/image_raw/compressed/parameter_updates
/front_camera/image_raw/compressedDepth
/front_camera/image_raw/compressedDepth/parameter_descriptions
/front_camera/image_raw/compressedDepth/parameter_updates
/front_camera/image_raw/theora
/front_camera/image_raw/theora/parameter_descriptions
/front_camera/image_raw/theora/parameter_updates

I tried recording the /front_camera/image_raw/compressed or /front_camera/image_raw/theora butI was not able to view the recorded images using image_view.

Thanks Markus

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2014-03-05 05:20:51 -0600

Dereck gravatar image

Record compressed stream via:

$ rosbag record /front_camera/image_raw/compressed

Play back recording with:

$ rosbag play <bagfile>
$ rosrun image_view image_view image:=/front_camera/image_raw compressed

note the space between the raw topic and the transport type in image_view.

edit flag offensive delete link more

Comments

Keep in mind that by default, compressed_image_transport uses JPEG, which is lossy. You can use dynamic_reconfigure to switch it to PNG.

Dan Lazewatsky gravatar image Dan Lazewatsky  ( 2014-03-05 08:34:03 -0600 )edit

I have a node that processes data from a sensor_msgs/Image topic, and I don't want to modify the code. Can I apply what you just said: record a bag file with compressed images, and then and somehow convert from compressed image to "raw" image when I read directly from the bag?

Tinrik gravatar image Tinrik  ( 2014-07-07 12:43:26 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-02-13 23:58:56 -0600

Seen: 10,015 times

Last updated: Mar 05 '14