OpenCV faceRecognizer predited label


I am using the facerecognizer EigenFaceRecognizer.

And I am using these instructions to get the label prediction:

Mat img = imread("person1/3.jpg", CV_LOAD_IMAGE_GRAYSCALE); // Some variables for the predicted label and associated confidence (e.g. distance): int predicted_label = -1; double predicted_confidence = 0.0; // Get the prediction and associated confidence from the model model->predict(img, predicted_label, predicted_confidence)

In the predicted_label, I got the label of the person the facerecognizer thinks is the most nearest to the one in the test image.

My question is: Is there any way to get the 5 closest labels for the image to identify???

label "1" predicted_confidence = 90 %
Label "1" predicted_confidence = 85 %
Label "4" predicted_confidence = 80 %
Label "20" predicted_confidence = 70 %
Label "7" predicted_confidence = 65 %
Thank you.
Topic archived. No new replies allowed.