Face Detection

This commit is contained in:
Alexandre VEROT 2023-02-19 11:47:16 +01:00
parent baac38d248
commit 9c62374570
1 changed files with 2 additions and 2 deletions

View File

@ -36,13 +36,13 @@ for i in range(num_frames):
gray_frame, scaleFactor=1.1, minNeighbors=5) gray_frame, scaleFactor=1.1, minNeighbors=5)
# print(face) # print(face)
# Dessiner un rectangle autour de chaque visage détecté and if fac is detected store information # Draw a rectangle on each detected face and if face is detected store information
if len(face) > 0: if len(face) > 0:
x, y, w, h = face[0] x, y, w, h = face[0]
face = frame[y:y+h, x:x+w] face = frame[y:y+h, x:x+w]
frame = cv2.rectangle(frame, (int(x*1.15), int(y*1)), frame = cv2.rectangle(frame, (int(x*1.15), int(y*1)),
(x + int(w*0.7), y + int(h*0.2)), (0, 255, 0), 3) (x + int(w*0.7), y + int(h*0.2)), (0, 255, 0), 3)
# Afficher l'image # Show image to check if the rectangle is well positioned on the forehead
# cv2.imshow("Faces", frame) # cv2.imshow("Faces", frame)
# cv2.waitKey(0) # cv2.waitKey(0)