Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[face_detection] Fix arg condition when launching with opencv4 in noetic #142

Open
wants to merge 4 commits into
base: indigo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 2.8.12)
project(opencv_apps)

## https://stackoverflow.com/questions/10984442/how-to-detect-c11-support-of-a-compiler-with-cmake
Expand Down
33 changes: 18 additions & 15 deletions launch/face_detection.launch
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,39 @@
<arg name="use_opencv3" default="false" />
<arg name="use_opencv3_1" default="false" />
<arg name="use_opencv3_2" default="false" />
<arg name="use_opencv3_3" default="$(arg use_opencv3)" />
<arg name="use_opencv4" default="false" />
<arg name="use_opencv3_3" default="false" />
<arg name="use_opencv4" default="true" />

<arg name="image" default="image" doc="The image topic. Should be remapped to the name of the real image topic." />

<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 name="queue_size" default="3" doc="Specigy queue_size of input image subscribers" />


<arg if="$(eval use_opencv3==True and use_opencv4==False)"
name="face_cascade_name" default="/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml" doc="Face detection cascade Filename" />
<arg if="$(eval use_opencv3==True and use_opencv4==False)"
name="eyes_cascade_name" default="/usr/share/opencv/haarcascades/haarcascade_eye_tree_eyeglasses.xml" doc="Eye detection cascade Filename" />

<arg if="$(arg use_opencv3_1)"
name="face_cascade_name" default="$(find opencv3)/../OpenCV-3.1.0-dev/haarcascades/haarcascade_frontalface_alt.xml" doc="Face dtection cascade Filename" />
name="face_cascade_name" default="$(find opencv3)/../OpenCV-3.1.0-dev/haarcascades/haarcascade_frontalface_alt.xml" doc="Face detection cascade Filename" />
<arg if="$(arg use_opencv3_1)"
name="eyes_cascade_name" default="$(find opencv3)/../OpenCV-3.1.0-dev/haarcascades/haarcascade_eye_tree_eyeglasses.xml" doc="Eye dtection cascade Filename" />
name="eyes_cascade_name" default="$(find opencv3)/../OpenCV-3.1.0-dev/haarcascades/haarcascade_eye_tree_eyeglasses.xml" doc="Eye detection cascade Filename" />
<arg if="$(arg use_opencv3_2)"
name="face_cascade_name" default="$(find opencv3)/../OpenCV-3.2.0-dev/haarcascades/haarcascade_frontalface_alt.xml" doc="Face dtection cascade Filename" />
name="face_cascade_name" default="$(find opencv3)/../OpenCV-3.2.0-dev/haarcascades/haarcascade_frontalface_alt.xml" doc="Face detection cascade Filename" />
<arg if="$(arg use_opencv3_2)"
name="eyes_cascade_name" default="$(find opencv3)/../OpenCV-3.2.0-dev/haarcascades/haarcascade_eye_tree_eyeglasses.xml" doc="Eye dtection cascade Filename" />
name="eyes_cascade_name" default="$(find opencv3)/../OpenCV-3.2.0-dev/haarcascades/haarcascade_eye_tree_eyeglasses.xml" doc="Eye detection cascade Filename" />
<arg if="$(arg use_opencv3_3)"
name="face_cascade_name" default="$(find opencv3)/../OpenCV-3.3.1-dev/haarcascades/haarcascade_frontalface_alt.xml" doc="Face dtection cascade Filename" />
name="face_cascade_name" default="$(find opencv3)/../OpenCV-3.3.1-dev/haarcascades/haarcascade_frontalface_alt.xml" doc="Face detection cascade Filename" />
<arg if="$(arg use_opencv3_3)"
name="eyes_cascade_name" default="$(find opencv3)/../OpenCV-3.3.1-dev/haarcascades/haarcascade_eye_tree_eyeglasses.xml" doc="Eye dtection cascade Filename" />
name="eyes_cascade_name" default="$(find opencv3)/../OpenCV-3.3.1-dev/haarcascades/haarcascade_eye_tree_eyeglasses.xml" doc="Eye detection cascade Filename" />


<arg if="$(arg use_opencv4)"
name="face_cascade_name" default="/usr/share/opencv4/haarcascades/haarcascade_frontalface_alt.xml" doc="Face dtection cascade Filename" />
name="face_cascade_name" default="/usr/share/opencv4/haarcascades/haarcascade_frontalface_alt.xml" doc="Face detection cascade Filename" />
<arg if="$(arg use_opencv4)"
name="eyes_cascade_name" default="/usr/share/opencv4/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" />
name="eyes_cascade_name" default="/usr/share/opencv4/haarcascades/haarcascade_eye_tree_eyeglasses.xml" doc="Eye detection cascade Filename" />

<!-- face_detection.cpp -->
<node name="$(arg node_name)" pkg="opencv_apps" type="face_detection" >
Expand Down
2 changes: 1 addition & 1 deletion launch/face_recognition.launch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<arg name="launch_face_detection" default="true" />
<arg name="launch_trainer" default="true" />

<arg name="use_opencv3" default="false" />
<arg name="use_opencv3" default="true" />
<arg name="use_opencv3_1" default="false" />
<arg name="use_opencv3_2" default="false" />
<arg name="use_opencv3_3" default="false" />
Expand Down
2 changes: 1 addition & 1 deletion test/test-face_detection.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<launch>
<arg name="gui" default="true" />
<arg name="use_opencv3" default="false" />
<arg name="use_opencv3" default="true" />
<arg name="use_opencv3_1" default="false" />
<arg name="use_opencv3_2" default="false" />
<arg name="use_opencv3_3" default="false" />
Expand Down
2 changes: 1 addition & 1 deletion test/test-face_recognition.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<launch>
<arg name="gui" default="true" />
<arg name="use_opencv3" default="false" />
<arg name="use_opencv3" default="true" />
<arg name="use_opencv3_1" default="false" />
<arg name="use_opencv3_2" default="false" />
<arg name="use_opencv3_3" default="false" />
Expand Down