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

Bagfile (containing depth and RGB data) to picture frames

asked 2014-12-12 07:26:57 -0600

shravan gravatar image

updated 2014-12-12 14:13:39 -0600

bvbdort gravatar image

When I convert a bagfile (containing depth and RGB data) to picture frames, I get different number of picture frames each time I launch the code given in the tutorial given below and the subsequent video I compile is totally wayward.

http://wiki.ros.org/rosbag/Tutorials/...

Please guide me through this

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-12-12 11:34:43 -0600

Wolf gravatar image

updated 2014-12-12 13:54:51 -0600

If the number of frames is different all the time probably your computer is not fast enough to save (and jpeg compress) all images with the same frequency they are coming out of the bag file.... Consider using the rosbag play -r (rate) option to slow down the message frequency (e. g. -r 0.2 to run at 20% of the original rate). Your computer should then be able to save all images without missing some. If therefore in the end your video looks kind of slow-mow you can speed it up using any common video processing program....

Edit example launch:

<launch>
  <node pkg="rosbag" type="play" name="rosbag" args="-r 0.2 -d 2 $(find image_view)/test.bag"/>
  <node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME">
    <remap from="image" to="/camera/image_raw"/>
  </node>
</launch>
edit flag offensive delete link more

Comments

Sorry if I ask anything silly. But I am new to ROS. I convert the rosbag to frames using the roslaunch file created in the tutorial. I never use the rosbag play command while doing this. So how and where should I change it? Thanks in advance

shravan gravatar image shravan  ( 2014-12-12 13:24:14 -0600 )edit

I edited the answer; See where I added the -r 0.2 in the launch sample of the tutorial you linked....

Wolf gravatar image Wolf  ( 2014-12-12 13:55:55 -0600 )edit

Thanks a lot for the answer. It helped me a lot :)

shravan gravatar image shravan  ( 2014-12-13 14:15:29 -0600 )edit
1

answered 2018-10-23 17:47:20 -0600

nihalsoans91 gravatar image

I had written a code for this long back, If it helps. https://github.com/nihalsoans91/Bag_to_Depth

edit flag offensive delete link more

Comments

Does your code extract the rdb image and the corresponding frame of depth? (Are they the same time frame for RGB and depth).

Beatrice gravatar image Beatrice  ( 2019-08-02 06:25:47 -0600 )edit

Hi Beatrice, Sorry about the delayed reply. I have updated the code to have it in sync . i.e have corresponding frame of depth. Also I have written c++ implementation for jpg files. Please let me know if you have any issues. You can also create an issue n the github repository.

nihalsoans91 gravatar image nihalsoans91  ( 2019-11-19 23:07:16 -0600 )edit

Question Tools

Stats

Asked: 2014-12-12 07:26:57 -0600

Seen: 1,705 times

Last updated: Oct 23 '18