The OpenImaj Tutorial for face analysis shows how to do face recognition using some test images from the face database - http://openimaj.org/tutorial/eigenfaces.html
How a new given image which is not from the face db can be recognized? Can you give an example?
Thanks.
Simple - just modify the code in the tutorial so that instead of looping over all the faces in the database, it just takes in an image you specify and searches with that:
FImage face = ...; //you load the face you want to search with here
DoubleFV testFeature = eigen.extractFeature(face);
String bestPerson = null;
double minDistance = Double.MAX_VALUE;
for (final String person : features.keySet()) {
for (final DoubleFV fv : features.get(person)) {
double distance = fv.compare(testFeature, DoubleFVComparison.EUCLIDEAN);
if (distance < minDistance) {
minDistance = distance;
bestPerson = person;
}
}
}
System.out.println("Best Guess: " + bestPerson);