Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confidence in OpenCV FaceRecognizer predict method output

I am using OpenCV for face recognition and have a newbie question. Here is a portion of my code:

recognizer = cv2.createLBPHFaceRecognizer()
...
nbr_predicted, confidence = recognizer.predict(predict_image)
...

My question is the higher the confidence is means faces are more similar or less similar?

like image 774
AVEbrahimi Avatar asked Nov 14 '25 19:11

AVEbrahimi


2 Answers

If the confidence is higher, then it means that the pictures are less similar, or in other words the lower, the better. Many people, including me, found this weird but I just changed my variable to be called loss instead of conf or confidence. Hope that answers your question.

like image 99
pn89348 Avatar answered Nov 17 '25 08:11

pn89348


There is an implementation about face recognition wich you can read here. They use OpenCV with face module.

In their read me there is an explanation about project and they say that confidence was more similiar when the number is lower. And vice-versa.

I have been studying about cv2.face with eigenfaces and fisherfaces and I received numbers around 10000 in my predictions but with LBPH I could predict with distance of 60~80.

Do you have any project about LBPH to share?

like image 40
Lucas Avatar answered Nov 17 '25 09:11

Lucas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!