<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)" />

    <!-- hough_lines.cpp -->
    <!-- 0: Standard Hough Line -->
    <include file="$(find opencv_apps)/launch/hough_lines.launch" >
      <arg name="debug_view" value="$(arg gui)" />
      <arg name="image" value="image_rect" />
      <arg name="hough_type" value="0" />
      <arg name="threshold" value="100" />
      <arg name="node_name" value="standard_hough_lines" />
    </include>

    <!-- Test Codes -->
    <node name="standard_hough_lines_saver" pkg="image_view" type="image_saver" args="image:=standard_hough_lines/image" >
      <param name="filename_format" value="$(find opencv_apps)/test/standard_hough_lines.png"/>
    </node>
    <param name="standard_hough_lines_test/topic" value="standard_hough_lines/lines" />    <!-- opencv_apps/LineArrayStamped -->
    <test test-name="standard_hough_lines_test" pkg="rostest" type="hztest" name="standard_hough_lines_test" >
      <param name="hz" value="20" />
      <param name="hzerror" value="19" />
      <param name="test_duration" value="5.0" /> 
    </test>

    <!-- 1: Probabilistic Hough Line -->
    <include file="$(find opencv_apps)/launch/hough_lines.launch" >
      <arg name="debug_view" value="$(arg gui)" />
      <arg name="image" value="image_rect" />
      <arg name="hough_type" value="1" />
      <arg name="threshold" value="100" />
      <arg name="node_name" value="probabilistic_hough_lines" />
    </include>

    <!-- Test Codes -->
    <node name="probabilistic_hough_lines_saver" pkg="image_view" type="image_saver" args="image:=probabilistic_hough_lines/image" >
      <param name="filename_format" value="$(find opencv_apps)/test/probabilistic_hough_lines.png"/>
    </node>
    <param name="probabilistic_hough_lines_test/topic" value="probabilistic_hough_lines/lines" />    <!-- opencv_apps/LineArrayStamped -->
    <test test-name="probabilistic_hough_lines_test" pkg="rostest" type="hztest" name="probabilistic_hough_lines_test" >
      <param name="hz" value="20" />
      <param name="hzerror" value="19" />
      <param name="test_duration" value="5.0" /> 
    </test>
  </group>
</launch>
