<launch>
  <arg name="gui" default="true" />
  <node name="play_face_bag" pkg="rosbag" type="play" args="-l $(find opencv_apps)/test/face_detector_withface_test_diamondback.bag" />

  <group ns="wide_stereo/left" >
    <node name="image_proc" pkg="image_proc" type="image_proc" />
    <node name="image_view" pkg="image_view" type="image_view" args="image:=image_rect_color" if="$(arg gui)" />

    <!-- segment_objects.cpp -->
    <include file="$(find opencv_apps)/launch/segment_objects.launch" >
      <arg name="use_camera_info" value="false" />
      <arg name="debug_view" value="$(arg gui)" />
      <arg name="image" value="image_rect" />
    </include>

    <!-- Test Codes -->
    <node name="segment_objects_saver" pkg="image_view" type="image_saver" args="image:=segment_objects/image" >
      <param name="filename_format" value="$(find opencv_apps)/test/segment_objects.png"/>
    </node>
    <param name="segment_objects_test/topic" value="segment_objects/contours" />    <!-- opencv_apps/ContoruArrayStamped -->
    <test test-name="segment_objects_test" pkg="rostest" type="hztest" name="segment_objects_test" >
      <param name="hz" value="20" />
      <param name="hzerror" value="15" />
      <param name="test_duration" value="5.0" /> 
    </test>
  </group>
</launch>
