<launch>

  <arg name="gui" default="true" />

  <node name="image_publisher"
        pkg="jsk_perception" type="image_publisher.py">
    <rosparam subst_value="true">
      file_name: $(find jsk_perception)/sample/kiva_pod_image_color.jpg
      publish_info: false
    </rosparam>
  </node>
  <arg name="INPUT_IMAGE" default="image_publisher/output" />

  <node name="selective_search"
        pkg="jsk_perception" type="selective_search.py">
    <remap from="~input" to="$(arg INPUT_IMAGE)" />
    <rosparam>
      min_size: 1000
      max_size: 1000000
    </rosparam>
  </node>

  <node name="draw_rects"
        pkg="jsk_perception" type="draw_rects">
    <remap from="~input" to="$(arg INPUT_IMAGE)" />
    <remap from="~input/rects" to="selective_search/output" />
  </node>

  <group if="$(arg gui)">
    <node name="$(anon image_view)"
          pkg="image_view" type="image_view">
      <remap from="image" to="draw_rects/output" />
    </node>
  </group>

</launch>
