FaceFinder - a .NET face detection mashup
FaceFinder is a web-based face detection system, very similar in nature to
BetaFace. It allows you to upload
an image file, and the faces in the picture will be marked. This is a proof-of-concept service, mashing together open source face detection software,
and my PhotoNotes implementation.
Use the form below to upload a photo and detect the faces in that photo.
FaceFinder is a mashup of the Intel OpenCV library, and my PhotoNotes javascript photo annotation script.
Using the SharperCV .NET wrapper for the OpenCV library, it was very easy to implement a simple class which takes an image file, and returns a list of rectangles representing the faces detected.
using System.Collections.Generic;
using SharperCV.Haar;
using SharperCV;
public class FaceFinder
{
public List<Rectangle> GetFaces(string filePath)
{
List<Rectangle> rects = new List<Rectangle>();
CvImage theImage = new CvImage(filePath);
ClassifierCascade cc;
cc = new ClassifierCascade("<default_face_cascade>",
new CvSize(24,24));
HiddenClassifierCascade hc;
hc = new HiddenClassifierCascade(cc,
null, null, null, 1);
CvRect[] faces;
faces = hc.DetectObjects(theImage,1.2,3,
PruningFlags.CannyPruning);
foreach(CvRect face in faces)
{
Rectangle rect = new Rectangle(face.x, face.y,
face.width, face.height);
rects.Add(rect);
}
return rects;
}
}
For each face, I can then create a corresponding PhotoNote
- v1 - 6/04/2006 - Initial release - Example source code Coming Soon!
You'll need the following two open source libraries in order to use FaceFinder.
This library is licensed under the
MIT License. You can use it for whatever you'd like, as long as the copyright notices remain in place.
SharperCV Version 1 may be freely used for non-commercial, academic, and personal use. It may not be redistributed or used as part of any commercial product.
Intel's OpenCV binary DLLs are separately subject to
this licence from Intel.