how faceRecognizer.predict provides face is matched or not [closed]

asked 2013-10-08 04:06:31 -0600

bunta gravatar image

updated 2013-10-08 04:11:30 -0600

berak gravatar image

I was trying to figure out openCV using javaCV layer. I found an example which almost close the example mentioned in openCV site.

 faceRecognizer.predict( greyTestImage, labels, new double[] {0.5} );
    int predictedLabel = faceRecognizer.predict(greyTestImage);

We are using finally the above predict method and it always return some value only if we set threshold as 0.0 , then it always return -1. I want to know how exactly I can derive that test image matched with the DB images or not. If I am using the API, how can i properly calculate nearest and confidence to deduce.

After reading the link http://docs.opencv.org/modules/contrib/doc/facerec/tutorial/facerec_save_load.html

I found

faceRecognizer.predict( greyTestImage, labels, new double[] {0.5} );

but anyway the above method is void type se again I am not getting the matched picture type.

Finally , the question can be concluded as how to use FaceRecognizer api to actually find the matched faces , after calling the predict method.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-11-05 14:17:36.901577

Comments

thanks for the link.checked the same. Now point is I set the threshold to 10 and found matching result are now coming only if exact match is there. So how this threshold works. any link.

bunta gravatar imagebunta ( 2013-10-08 05:14:12 -0600 )edit

10 is probably too small. check, what is returned in dist, and base on that

berak gravatar imageberak ( 2013-10-08 05:34:46 -0600 )edit

as you talked about dist, that's what I was trying to find out . unfortunately couldn't.. can u link some api for my understanding..

bunta gravatar imagebunta ( 2013-10-08 05:56:38 -0600 )edit

float projectedTrainFaceDistance = (float) projectedTrainFaceMat.get(iTrain, i); is the to get the distance but what is the keyword for getting the projectedTrainFaceMat....faceRecognizer.getMat("XYZ"); what is the param to be passed here

bunta gravatar imagebunta ( 2013-10-08 06:04:43 -0600 )edit