Open arasharchor opened 6 years ago
Use LBPHFace recognizer. for this all images doesn't need to be in same size.
def predict(test_img):
img = test_img.copy()
face, rect = detect_face(img)
face = cv2.resize(face, (100, 100))
label_text, confidence = face_recognizer.predict(face)
return label_text
for eigenface you need equal size of images the database as well as the testing images you can resize them for the code to work
by just commenting LBF and uncommenting FisherFace or EigenFace I am getting the following error
face_recognizer.train(faces, np.array(labels)) cv2.error: OpenCV(3.4.1) /home/majid/opencv_contrib/modules/face/src/eigen_faces.cpp:72: error: (-210) In the Eigenfaces method all input samples (training images) must be of equal size! Expected 143641 pixels, but was 6724 pixels. in function train