opencv-face-recognition-python
opencv-face-recognition-python copied to clipboard
issues on opencv 3.3.0 version
hi Ramiz,
First of all, great tutorial, thank you.
When i (pip) installed the requirement for this tutorial, I've got OpenCV 3.3.0 and it had some issues with your code.
I've done few adjustments to make it work:
-
Changed the creation of the recognizer from
face_recognizer = cv2.face.createLBPHFaceRecognizer()
toface_recognizer = cv2.face.LBPHFaceRecognizer_create()
-
In the predict function changed this
label = face_recognizer.predict(face)
tolabel, confidence = face_recognizer.predict(face)
The "predict" returns you a value of confidence also, and that addition fixed the TypeError.
Hello,
But when changed to
face_recognizer = cv2.face.LBPHFaceRecognizer_create()
it gives me an error while execution as: 400: error: (-5) This LBPH model is not computed yet. Did you call the train method? in function cv::face::LBPH::predict
I suppose it means I have to call LBPHFaceRecognizer class..? Even though I have, just like in code given... Can this problem be solved?