diff --git a/robot_vision/launch/face_detector.launch b/robot_vision/launch/face_detector.launch index 586594b..cb379c6 100644 --- a/robot_vision/launch/face_detector.launch +++ b/robot_vision/launch/face_detector.launch @@ -18,4 +18,12 @@ + + + diff --git a/robot_vision/launch/motion_detector.launch b/robot_vision/launch/motion_detector.launch index 95a6d81..08edbaf 100644 --- a/robot_vision/launch/motion_detector.launch +++ b/robot_vision/launch/motion_detector.launch @@ -14,4 +14,12 @@ threshold: 25 + + + diff --git a/robot_vision/scripts/face_detector.py b/robot_vision/scripts/face_detector.py index 1e9fc8f..2846853 100644 --- a/robot_vision/scripts/face_detector.py +++ b/robot_vision/scripts/face_detector.py @@ -63,7 +63,7 @@ def image_cb(msg, cv_bridge, haar_param, image_pub): if len(faces_result) > 0: for face in faces_result: x,y,w,h = face - cv2.rectangle() + cv2.rectangle(cv_image, (x, y), (x+w, y+h), haar_param.color, 2) else: print("%u: no face in current image" %rospy.get_time()) diff --git a/robot_vision/scripts/motion_detector.py b/robot_vision/scripts/motion_detector.py index cadc625..aa7b1a4 100644 --- a/robot_vision/scripts/motion_detector.py +++ b/robot_vision/scripts/motion_detector.py @@ -39,7 +39,7 @@ def image_cb(msg, cv_bridge, detector_param, image_pub): for c in cnts: # 如果检测到的区域小于设置值,则忽略 - if cv2.contourArea(c) < self.minArea: + if cv2.contourArea(c) < detector_param.minArea: continue # 在输出画面上框出识别到的物体