Hello,
I put together code to detect faces from a video file, and save the cropped detected faces in individual files. The result is tenss of individual image files for every person.
Is there a mechanism to track the face in the scene and obtain the best possible image, this way the result is one good image per person.
code segment related to the above:
for (fX, fY, fW, fH) in faceRects:
cv2.rectangle(frameClone, (fX, fY), (fX + fW, fY + fH), (0, 255, 0), 2)
sub_face = frameClone[fY:fY+fH, fX:fX+fW]
face_file_name = "faces/face_" + str(fY) + str(fX) + ".jpg"
cv2.imwrite(face_file_name, sub_face)
# show our detected faces
cv2.imshow("Face", frameClone)
I would appreciate any help or pointers
↧