what predict function returns in createEigenFaceRecognizer()?

 rec=cv2.createEigenFaceRecognizer(); sns,conf=rec.predict(Test_Image);  One of the values it returns is sns the ID number of face detected and the other value it returns (conf) lies in range 1000 to 2000 .Does it returns 100*Error percentage (conf) ?

 rec=cv2.createLBPHFaceRecognizer(); sns,conf=rec.predict(Test_Image);  In case of createLBPHFaceRecognizer it returns id number (sns) and error percentage (conf) .

My questions is what does predict function of createEigenFaceRecognizer() returns ?

edit retag close merge delete

Sort by ยป oldest newest most voted

One of the values it returns is the ID number of face detected

correct. (that was simple)

the other value it returns (conf)

that's not so simple. it''s the (L2) distance to the nearest image in the database, it's more the opposite of a "confidence" (less is better) and it'S entirely non-linear, so you won't find an easy formula to make it a percentage or such.

lies in range 1000 to 2000

that's arbitrary, it depends on your local database.

in the end, you'll probably set a threshold value from the worst true and the best false recognition.

more

How to find percentage or confidence using it , if i need to test how accurate results the algorithm gives ?

( 2019-09-02 07:00:42 -0600 )edit

so how i know that if this algorithm(PCA or EigenFace) is better than the LBPH ?

( 2019-09-02 07:10:58 -0600 )edit

berak i studied that EigenFace algorithm gives better result compared to LBPH , how i prove it if i cannot get error percentage ?I read your answer and it is helpful .Thanks for it .

( 2019-09-02 07:13:51 -0600 )edit

i studied that EigenFace algorithm gives better result compared to LBPH

that's nice, but probably only with your current data, and may change with different images.

so how i know that if this algorithm(PCA or EigenFace) is better than the LBPH ?

you do tests with ground truth data, correct prediction or not. measure accuracy, confusion matrix.

( 2019-09-02 11:29:43 -0600 )edit

What is confusion matrix ? @berak

( 2019-09-02 13:53:09 -0600 )edit

@berak i am doing self project and not HW .But you answer helped me , hence i accept it

( 2019-09-03 08:19:08 -0600 )edit

apologies for the rudeness, sorry.

( 2019-09-03 08:59:43 -0600 )edit