Confidence is always zero

asked 2016-08-11 21:44:48 -0500

san_opencv gravatar image

updated 2016-08-12 03:27:41 -0500

Hi I am using opencv 2.4.x I am trying to recognize the image. I have cropped the rectangular part of faces, greyed it out, and fed it to Fischer face recognition algorithm.

I do get the predicted label, but the predicted confidence is always zero.

I read the defination of confidence of Face recognition api (Opencv 3.0), and prediction confidence is defined as distance of the predicted label.

So the confidence of 0.0 means the image is successfully recognized or is it the other way round?.

edit retag flag offensive close merge delete


" I have cropped the rectangular part of faces, greyed it out" <-- can you explain the latter ?

berak gravatar imageberak ( 2016-08-12 01:59:52 -0500 )edit

Yes I used the face detection methods of opencv, and using Mat objects, I processed on it ( graying out the image, and getting the face part of the image )... and then used these images as samples for face recognition..

san_opencv gravatar imagesan_opencv ( 2016-08-12 03:21:35 -0500 )edit

i still don't understand the "greying out" part. what is this for ?

also, you're supposed to resize the cropped face portion to the same fixed size, your train images have, and use that for the prediction.

berak gravatar imageberak ( 2016-08-12 03:29:40 -0500 )edit

Yes berak, I cropped (resized) the image to size of 150 X 150. I greyed it out for face detection. OMG, i supplied the same grey images for face recognition. Let me try with color images only. Thanks for pointing it out berak :-)

san_opencv gravatar imagesan_opencv ( 2016-08-12 03:38:51 -0500 )edit

I guess with greying out he means COLOR_BGR2GRAY conversion ;)

StevenPuttemans gravatar imageStevenPuttemans ( 2016-08-12 03:42:49 -0500 )edit

Yes Steven, I meant the same. Also I read in opencv answers that Fishcher algo requries greyed out images, and not the colored ones. So I guess I need to use grey images for face recognition.

san_opencv gravatar imagesan_opencv ( 2016-08-12 04:11:04 -0500 )edit

please then - it's "grayscale" image, not "greyed out"

(and yea, entirely mistook it for something else)

berak gravatar imageberak ( 2016-08-12 04:17:15 -0500 )edit

oh sorry my mistake... But if the confidence always comes to zero, it means the face recognition is not successful right? Because even though the confidence is zero, I do get the predicted label...

san_opencv gravatar imagesan_opencv ( 2016-08-12 04:28:59 -0500 )edit

you always get a predicted label.

if that's the wrong one and the confidence is 0, - then your data flow is borked.

berak gravatar imageberak ( 2016-08-12 05:06:45 -0500 )edit