Project Description face detection project makes it easier for Silverlight, .NET, Windows Phone 7 developers to detect faces from any image. Facial tracking algorithm is based on Haar features and adaboost training. The project is NOT based on OpenCV, it is an independent one. It is developed in pure C#

Original project home page is (you can test online face detection demo here). Currently we are working on improvement of detection for dark skin color and on detection of more feature points.

Also we have a face recognition system for web camera login. Online demo is here

usage is very simple:

// set custom start button text and initialize face detection runtime
faceDetectionControl.Initialize("Start the sample");

// subscribe to detection event
faceDetectionControl.FirstFaceDetectedPositionChanged += new Action<Rect?>(faceDetectionControl_FirstFaceDetectedPositionChanged);

// set custom video width and height
faceDetectionControl.CaptureVideoHeight = 240;
faceDetectionControl.CaptureVideoWidth = 320;


void faceDetectionControl_FirstFaceDetectedPositionChanged(Rect? firstDetectedFacePosition)
	// here we get position of first detected face or null if no faces are detected
	if (firstDetectedFacePosition.HasValue)
		Debug.WriteLine(String.Format("face detected at {0};{1} - {2};{3}",
			firstDetectedFacePosition.Value.Left, firstDetectedFacePosition.Value.Top,
			firstDetectedFacePosition.Value.Width, firstDetectedFacePosition.Value.Height));
		// todo: use it in your application
		Debug.WriteLine("no faces detected");
// request list of detected faces from face detection control
var detectedFacesWithFeaturePoints = faceDetectionControl.Detector.GetDetectedFacesWithFeaturePoints();
if (detectedFacesWithFeaturePoints.Count == 0)
	MessageBox.Show("No faces are detected");
	MessageBox.Show(String.Format("Detected faces:\r\n{0}", 
			detectedFacesWithFeaturePoints.Select(x => String.Format(
				"face left = {0} top = {1} width = {2} height = {3}", 
				x.FacePosition.Left, x.FacePosition.Top, x.FacePosition.Width, x.FacePosition.Height
				//  you can also access  x.DetectedFeaturePoints in order to get eyes and mouth coordinates

You can read about Face detection algorithm here.


Face Detection Applications

Face Detection is an innovative technology which can be integrated into any webpage as a Silverlight plug in. It takes snapshots using a web camera, searches for one or multiple faces in an image using a sophisticated two-dimensional DSP algorithm.

Our brand new intellectual algorithm goes beyond the limits of all existing technologies as it obtains the unique functional features that enable the application to:

·         work stably with any skin color

·         accept low-quality images (e.g. pixilated, blurred, noised, darkened, etc.)

·         detect faces with glasses

·         determine the position of the particular facial features (e.g. eye pupils, nose, lips, etc.)

·         detect several faces on one image

Face Detection technology may be used as a core component (basis) for a great number of applications with a wide sphere of usage.

1.       Smart captcha. It is a variety of an already existing captcha which uses graphic images and sounds. However, using a face and/or motion detection technology you are not going to bother users with recognizing bizarre letters and unclear sounds any more. All the user needs is to show his face in motion so that the website owner is sure that he is a human being, not a machine. No more losing partners and visitors, no worry of being spammed by robots.

2.       Webcam based energy/power saver. This is an absolutely innovative idea which may be helpful to everyone who uses a PC, TV or some other types of household appliances. The main feature here is to switch on a sleep mode or reduce the brightness of a screen whenever a user’s face is away from his device for more than 5-10 minutes and to set it back to work automatically when a user’s face is detected. There is no need to say that nowadays the problem of power saving is one of the most urgent. Using face detection module you will be closer to its solving than ever.

3.       Time tracking service. If you are interested in tracking the billed hours of your employees this is exactly what you need. No way to cheat you, no more money spent in vain. You will only pay for hours spent by your employee on his working place. In case a web camera no longer detects a face and/or motion in front of it the time tracking is stopped. In the moment a person comes back it starts again. As easy as ABC.

4.       Outdoor surveillance camera service. Face and motion detection technology may help making a good service to keep you secure. Firstly, it will give you a signal of somebody’s coming even before he rings the doorbell. Secondly, with its help you will be able not to watch the whole video recording when it is necessary, but to choose the periods when motion or face was detected, so that it saves your time considerably.

5.       Video chat service. If you are an owner of a video chat our application should meet some of your needs. All of your customers obviously have a webcam. Unfortunately, there are the people who tend to spoil your reputation making the rest of the users see indecent pictures of a sexual nature. Using the face detection technology you can be sure that all of the visitors of your website behave properly and feel comfortable even if their children use this service. Moreover, it could be a sound idea to use the face detection module to define the status of the visitor. If he is not present in front of the screen he obtains an “Away” status, when he comes back and his face is detected, “Online” status appears and the rest of the users are able to see him again.


Last edited Feb 5, 2012 at 6:30 PM by asv128, version 20