[fix] yes

This commit is contained in:
jieshoudaxue
2023-08-11 09:34:21 +08:00
parent 063aa55207
commit 473864de31
4 changed files with 18 additions and 2 deletions
+8
View File
@@ -18,4 +18,12 @@
<param name="cascade_1" value="$(find robot_vision)/data/haar_detectors/haarcascade_frontalface_alt.xml" />
<param name="cascade_2" value="$(find robot_vision)/data/haar_detectors/haarcascade_profileface.xml" />
</node>
<node
pkg="rqt_image_view"
type="rqt_image_view"
name="rqt_image_view"
output="screen"
/>
</launch>
@@ -14,4 +14,12 @@
threshold: 25
</rosparam>
</node>
<node
pkg="rqt_image_view"
type="rqt_image_view"
name="rqt_image_view"
output="screen"
/>
</launch>
+1 -1
View File
@@ -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())
+1 -1
View File
@@ -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
# 在输出画面上框出识别到的物体