In Mathematica 9, the FindFaces
command offers an easy way to detect faces. In some experiments, I've been getting reasonable results, but I'd like to know if there are ways to improve the success rate.
As with the online help example, I thought the 1927 Solvay Conference photograph was a good place to start. You can find it on the Wikimedia here, at 3000 by 2171 pixels.
solvay = Import["http://upload.wikimedia.org/wikipedia/commons/6/6e/Solvay_conference_1927.jpg"];
faces = FindFaces[solvay]
which returns a list of rectangles:
{{{81.5, 1105.5}, {262.5, 1286.5}}, {{133.5, 1038.5}, {231.5, 1136.5}}, ...
Using these to chop out some passport photographs:
passports = ImageTrim[solvay, #] & /@ faces
gives this:
I can get rid of the images that are too large by using the optional minimum and maximum sizes:
faces1 = FindFaces[solvay, {85, 130}];
passports1 = ImageTrim[solvay, #] & /@ faces1
But it's still not perfect. (The online help example seems to miss more people than I do, but there are no false positives, unlike my interesting collection of masonry people.
How would I improve these results? Is Mathematica
's built-in function capable of better results, or is it just, well, a toy?