The number of images extracted is lesser than the messages specified in the bag file

asked 2016-10-27 01:21:57 -0600

vishwa gravatar image

updated 2016-10-27 01:48:25 -0600

Hi all,

I am trying to extract images from a bag file. I am posting the images related contents of the bag file alone, below:

path:        dataset-2-2.bag
version:     2.0

duration:    58:53s (3533s) 

start:       Oct 04 2016 00:23:10.30 (1475520790.30)

end:         Oct 04 2016 01:22:03.91 (1475524323.91)

size:        182.8 GB

messages:    5800842

compression: none [211980/211980 chunks]

types:       
             sensor_msgs/Image                     [060021388200f6f0f447d0fcd9c64743]

topics:   
             /center_camera/image_color           70659 msgs    : sensor_msgs/Image                    
             /left_camera/image_color              70660 msgs    : sensor_msgs/Image                    
             /right_camera/image_color            70660 msgs    : sensor_msgs/Image

The number of images are 70660. Based on the duration of 3533s and numbre of images, the sec_per_frame works out to be 0.05 (20fps)

I ran the following .launch script to extract the images:

<launch>
  <node pkg="rosbag" type="play" name="rosbag" args="-d 2 /path/to/dataset.bag"/>
  <node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME">
  <param name="sec_per_frame" value="0.05"/>
  <param name="file_format" value="frame%05d.jpg"/>
    <remap from="image" to="/left_camera/image_color"/>
  </node>
</launch>

But I am only able to extract 10923 frames and the process is finishing cleanly as well. I am not able to understand where the issue is. Am I missing some flag? Please help me in this regard. I am a newbie to ROS.

edit retag flag offensive close merge delete