mirror of
https://github.com/Jieshoudaxue/ros_senior.git
synced 2026-08-29 08:34:43 +08:00
[fix] yes
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
# 在输出画面上框出识别到的物体
|
||||
|
||||
Reference in New Issue
Block a user