I'm getting married! - More Details

FaceFinder - a .NET face detection mashup

Overview

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.

Demo

Use the form below to upload a photo and detect the faces in that photo.

Upload!


Note: This system doesn't currently detect faces, due to security restrictions at my web host. Please see this blog entry:
Unsafe code & Partial Trust

Implementation

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

Versions

  • v1 - 6/04/2006 - Initial release - Example source code Coming Soon!

Requirements

You'll need the following two open source libraries in order to use FaceFinder.

  • OpenCV - Intel's Open Source Computer Vision Library - Download here
  • SharperCV- A .NET wrapper library for OpenCV - Download here

License

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.


Comments

Dusty
Currently the upload form is not functional. This is due to a security restriction imposed by my web host. Read more here: http://www.dustyd.net/archive/2006/06/06/Unsafe-code-Partial-Trust.aspx
Noah
dude, still have my own public ip and linux server if you want some space to play.
adnan
hallo
Jimmy
bad program, i have uploaded many peoples(MR. Bean, teletubbies,??) photos, not photo can detect a face......... go to debug debug
quaden
that is very nice


Post a comment

   
 
  
  

    

All content © Dusty Davidson