feat 新增人脸识别 中心点检测

This commit is contained in:
zchen
2024-04-26 15:37:16 +08:00
parent 27d96a80b9
commit 0c2cf1ec02
2 changed files with 14 additions and 8 deletions

View File

@@ -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)