Realsense D435i录制rosbag后提取jpeg图像
启动相机
roslaunch realsense2_camera rs_camera.launch
录制rosbag
robag record /camera/color/image_raw
提取图像
roslaunch export_pic.launch
mv ~/.ros/frame*.jpg folder
其中,export_pic.launch写法如下:
<launch>
<node pkg="rosbag" type="play" name="rosbag" required="true" args="/home/robot/mydog_ws/picture/2021-01-18-16-45-49.bag"/>
<node name="extract" pkg="image_view" type="extract_images" respawn="false" required="true" output="screen" cwd="ROS_HOME">
<remap from="image" to="/camera/color/image_raw"/>
<param name="sec_per_frame" value="0.01"/>
</node>
</launch>
注:
1 args="/home/robot/mydog_ws/picture/2021-01-18-16-45-49.bag"/一句代表rosbag的路径;
2 param name=“sec_per_frame” value="0.01"一句中, name代表提取图片的名称,输出的图像名为“frame0001、frame0002、frame0003……”,value代表提取图片的帧率。
(平时使用只需要改动这几个地方)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)