Ask Your Question

Revision history [back]

Why Does FaceRecognizers predict function return 1.79769e+308 as distance.

Hello everybody, I am using opencv and LBPHFaceRecognizer and I am observing a strange behaviour of predict function when looking at an unknown face:

 int radius=1;
 int neighbors=8;
 int grid_x=8;
 int grid_y=8;
 double threshold=DBL_MAX;

_lbhp_recognizer = createLBPHFaceRecognizer(radius,neighbors,grid_x,grid_y,threshold);
_lbhp_recognizer->train(training_set,_labels);
_lbhp_recognizer->predict(face_gray,label,confidence);

Seems to work correctly since it returns confidence=136.55 and a label corresponding to the best approximation of my unknown face.

However when I modify threshold in order to be less than 136.55 as follows

double threshold=130;

I obtained confidence=1.79769e+308 and label=0 !

As far as I understood threshold and predict I should obtained label=-1 since the distance to the best approximation is greater than threshold ...

I am be bit lost then.

Thanks !