feat 新增人脸识别 中心点检测
This commit is contained in:
@@ -263,6 +263,12 @@ def face_detect_pic(image):
|
||||
# 3、检测人脸(用灰度图检测,返回人脸矩形坐标(4个角))
|
||||
faces_rect = face_detector.detectMultiScale(gray, 1.05, 3)
|
||||
|
||||
if DEBUG:
|
||||
dst = image.copy()
|
||||
for x, y, w, h in faces_rect:
|
||||
cv2.rectangle(dst, (x, y), (x + w, y + h), (0, 0, 255), 3) # 画出矩形框
|
||||
cv2.imshow("", dst)
|
||||
cv2.waitKey(0)
|
||||
return len(faces_rect)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user