opencv-face-recognition-python icon indicating copy to clipboard operation
opencv-face-recognition-python copied to clipboard

training on EigenFace and FisherFace failed.

Open arasharchor opened this issue 6 years ago • 3 comments

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

arasharchor avatar Mar 10 '18 18:03 arasharchor

Use LBPHFace recognizer. for this all images doesn't need to be in same size.

ramineniraviteja avatar Mar 26 '18 11:03 ramineniraviteja

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

ghost avatar Jul 09 '18 14:07 ghost

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

AyushTejwani avatar Jul 20 '18 21:07 AyushTejwani