Skip to content

Commit

Permalink
fix face_detection.launch to accept args for cascade xml for opencv3
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Aug 25, 2016
1 parent b7f976e commit d091416
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
19 changes: 11 additions & 8 deletions launch/face_detection.launch
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@
<arg name="use_camera_info" default="false" doc="Indicates that the camera_info topic should be subscribed to to get the default input_frame_id. Otherwise the frame from the image message will be used." />
<arg name="debug_view" default="true" doc="Specify whether the node displays a window to show edge image" />

<arg if="$(arg use_opencv3)"
name="face_cascade_name" default="$(find opencv3)/../OpenCV-3.1.0-dev/haarcascades/haarcascade_frontalface_alt.xml" doc="Face dtection cascade Filename" />
<arg if="$(arg use_opencv3)"
name="eyes_cascade_name" default="$(find opencv3)/../OpenCV-3.1.0-dev/haarcascades/haarcascade_eye_tree_eyeglasses.xml" doc="Eye dtection cascade Filename" />
<arg unless="$(arg use_opencv3)"
name="face_cascade_name" default="/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml" doc="Face dtection cascade Filename" />
<arg unless="$(arg use_opencv3)"
name="eyes_cascade_name" default="/usr/share/opencv/haarcascades/haarcascade_eye_tree_eyeglasses.xml" doc="Eye dtection cascade Filename" />

<!-- face_detection.cpp -->
<node name="$(arg node_name)" pkg="opencv_apps" type="face_detection" >
<remap from="image" to="$(arg image)" />
<param name="use_camera_info" value="$(arg use_camera_info)" />
<param name="debug_view" value="$(arg debug_view)" />
<param if="$(arg use_opencv3)"
name="face_cascade_name" value="$(find opencv3)/../OpenCV-3.1.0-dev/haarcascades/haarcascade_frontalface_alt.xml" />
<param if="$(arg use_opencv3)"
name="eyes_cascade_name" value="$(find opencv3)/../OpenCV-3.1.0-dev/haarcascades/haarcascade_eye_tree_eyeglasses.xml" />
<param unless="$(arg use_opencv3)"
name="face_cascade_name" value="/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml" />
<param unless="$(arg use_opencv3)"
name="eyes_cascade_name" value="/usr/share/opencv/haarcascades/haarcascade_eye_tree_eyeglasses.xml" />
<param name="face_cascade_name" value="$(arg face_cascade_name)" />
<param name="eyes_cascade_name" value="$(arg eyes_cascade_name)" />
</node>
</launch>
1 change: 1 addition & 0 deletions test/test-face_detection.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<include file="$(find opencv_apps)/launch/face_detection.launch" >
<arg name="debug_view" value="$(arg gui)" />
<arg name="image" value="image_rect" />
<arg name="use_opencv3" value="$(arg use_opencv3)" />
</include>

<!-- Test Codes -->
Expand Down

0 comments on commit d091416

Please sign in to comment.