Ask Your Question
0

confidence value in LBPH

asked 2020-02-23 07:01:37 -0600

updated 2020-02-23 07:27:34 -0600

supra56 gravatar image

Ex:

id,confidence=recognizer.predict(gray[y:y+h,x:x+w])
confidence=100*(1-(confidence)/300))

what is this calculation i did'nt understand this formula to get confidence value maximum

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2020-02-23 11:35:13 -0600

berak gravatar image

updated 2020-02-23 11:37:33 -0600

opencv's FaceRecognizer classes return the distance from your img to the closest item in the database, not a confidence (it's the opposite), that's a misnomer in the code already.

the code you're trying with attempts to "normalize" the distance to [0..1] by dividing by some large value (300 here, but unfortunately, this heavily depends on your data !!!), then tries to invert it (1-x) to get a "confidence", and then scales to [0..100], to get something in %.

please note, that all of it is "heuristic", there's no silver bullet or exact formula for this (the distances are not even "linear") so play with it on your own data, but use "with a grain of salt" ;)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-02-23 07:01:37 -0600

Seen: 976 times

Last updated: Feb 23 '20