Face recognition - Get distance for all trained images
Hi,
I have just begun using OpenCV in the past week and i am hoping to get a little advice :).
I am currently using the FaceRecognizer to train a set of images and then use predict to compare a face against that trained set of images. This appears to be working fine, however it only retrieves the label with the best score whereas I was hoping to be able to retrieve the score and label for each trained image.
So say i have trained 10 images, i then have an image i want to compare against that trained set of images. My ideal output would be.
img1, distance
img2, distance
img3, distance
etc..
Is this possible?
Im not sure if it makes a big difference but i want to use each technique available and test the results. So Eigenfaces, Fisherfaces and LBP
So essentiall what im doing is.
Ptr<FaceRecognizer> model = createLBPHFaceRecognizer();
model->train(images , labels);
int predictedLabel;
double distance;
model->predict(testSample , predictedLabel , distance);
And essentially what i want is an array of labels and array of distance returned. Which isn't how it works haha.
what do you want to do with that information ?
a real database won't have 10 images, more like 1000, so you'll pretty soon find out, that only the best result matters.
That's just an example, i do have a large database of images. I am doing a study where i require all of the results. And in real life if you have a large database it is possible to have multiple images with very close scores. So if that's the case the close matches should then be displayed to the user to allow them to decide.
ah, ok. that would be more a knn-search instead of the current nearest neighbour one
maybe this related question helps