Good evening everyone,
I have tried to use this
Keep in my that my Ptr variable is of type BasicFaceRecognizer as per OpenCV 3.0 documentation: http://docs.opencv.org/master/db/d7c/group__face.html#gsc.tab=0
Ptr<BasicFaceRecognizer> model;
int label = -1;
double confidence = 0.0;
this->imageManager = pManager;
this->model = createEigenFaceRecognizer();
this->model->train(pManager->getOpenCVTrainImages(), pManager->getTrainLabels());
for(Mat& imageToTest : pManager->getOpenCVTestImages())
{
this->model->predict(imageToTest, label, confidence);
cout << "Class: " << label
<< " The confidence predicted towards the test image is: " << confidence << endl;
}
When running this code, it correctly identifies the label (which is a good thing) however, if the test image is run against a subset not part of its class I was expecting to receive a class of -1 or a really LOW confidence.
In this example I have not set the face recognizer to 10 PCA components and I did not set a threshold. However, I have tried to run it with a createEigenFaceRecognizer(10, 123.0) or createEigenFaceRecognizer(10, 50.0) or createEigenFaceRecognizer(0, 1.0)...
All of the above return me a confidence of 0. Which seems very unlikely or impossible I was expecting at least a few numbers.
What am I doing wrong, is this a bug?