Save images as 8-bit grayscale in image_view extract from rosbag file
Hello,
I use a launch-file in order to extract images from a stereo-camera (stereo/left & stereo/right). Thereby I use the package "image_view" with the node "extract" to grab the images from my bagfile.
<launch>
<arg name="path" default="/home/viki/bagfiles" />
<arg name="bagfile" default="bagfile_stereo_raw.bag" />
<arg name="folder_name" default="default_image_folder" />
<arg name="format" default="png" />
<param name="/use_sim_time" value="true" />
<node name="rosbag" pkg="rosbag" type="play"
args="--clock -d 4 $(arg path)/$(arg bagfile)" />
<node name="extract1" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME" >
<remap from="image" to="/stereo/left/image_rect" />
<param name="filename_format" value="/stereo_images/$(arg folder_name)/left/left_image%04i.$(arg format)"/>
</node>
<node name="extract2" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME" >
<remap from="image" to="/stereo/left/image_rect" />
<param name="filename_format" value="/stereo_images/$(arg folder_name)/right/right_image%04i.$(arg format)"/>
</node>
</launch
I now receive all the desired images but they are 24-bit images. Now my question is: How can I setup the launch-file in order to receive 8-bit (grayscale) images? I cannot find any documentation regarding this. Also my question is how to obtain parameters from nodes like "extract" in ROS in general. I found out that there is a parameter called "file_format" for "extract" in the ROS answer sites but how can I see all the different parameters there are for this node. (I am sure my question would resolve by acquiring this info).
Also one other question: I need to create the directories before saving the images (with the launch file) into them. Is there a way that the roslaunch file creates the desired directories by itself?
Thanks in advance! Hector
I believe your question about creating directories has been asked and answered elsewhere. ( http://answers.ros.org/question/188298/how-to-create-directories-in-a-ros-launch-file/ )
image_proc should be able to create mono images from color images, but it looks like you're already subscribing to a mono topic. Are the saved images color or monochrome when viewed?
There isn't any documentation of the extract_images node on the image_view wiki page. Perhaps you can write it once you've figured out all of the details?
@ahendrix yes i can do that. unfortunately I couldn't find the site where ic an edit the documentaion for extract_images. can you give me a link for a tutorial how to create this docu?
The wiki page for image_view is http://wiki.ros.org/image_view , and you can sign up for an account here