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 !
which opencv version is it ?
(looking at the 3.1 src, it seems, @comdiv 's latest update changed the default from -1 to 0)
actually, do we agree, that the distance is correct, but the label is not (should be -1) ?
Well, version 3.1. Do you mean that the behaviour of predict is to return distance 1.79769e+308 when the computed distance is greater than the threshold ? If it is the case then yes my problem is the fact that the returned label is 0 and not -1 .
Thanks !
i'm unsure, what distance should be returned, if it did not pass the threshold test, but imho, it should return -1 for the label in this case, like the previous versions did.
anyway, bug, pr on the way ...
:), thanks !