Click here to Skip to main content
11,500,413 members (70,509 online)
Click here to Skip to main content

Tagged as

Face detection in Windows Phone 7

, 1 Jan 2011 CPOL 19.7K 11
Rate this:
Please Sign up or sign in to vote.
I was recently searching for face detection libraries which would work with Windows Phone 7. Browsing CodePlex, I landed on Facelight, a simple face recognition method written in Silverlight by René Schule. Facelight is open-source (thanks, René), so it was a trivial task to port it to Windows Phone

I was recently searching for face detection libraries which would work with Windows Phone 7. Browsing CodePlex, I landed on Facelight, a simple face recognition method written in Silverlight by René Schulte. Facelight is open-source (thanks, René), so it was a trivial task to port it to Windows Phone. I made almost no changes in its initial code; to be honest, I only added an intermediate class in order to separate the pure face detection code from the user interface.

I developed an application demonstrating its use. You are free to download and have fun with it. Source code is included, too. Here is the result of Windows Phone face detector:

Windows Phone 7 face detectionWindows Phone 7 face detection

Using Facelight is a piece of cake. You only need two XAML image controls placed in the same position. The upper one (named ImgResult) will contain a red ellipse specifying the recognized face and the other one (named ImgOverlay) will contain the original bitmap source. Using the adapter I created for Facelight, you can write the following:

   1. FaceDetector faceDetector = new FaceDetector();  
   2.   
   3. BitmapImage bmpImage = new BitmapImage();  
   4. bmpImage.SetSource(someStream);  
   5.   
   6. ImgOverlay.Source = bmpImage;  
   7. ImgResult.Source = faceDetector.Process(new WriteableBitmap(bmpImage));

The application I developed lets you select a saved photograph right from your device! Be sure to have your Phone disconnected from the PC before trying it out.

Note: Facelight recognizes up to one face per picture. It is actually a skin detector you can utilize in your applications.

Download demo. Includes:

  • FaceLight Silverlight class library (originally ported from René Schulte FaceLight project). Licensed as described in CodePlex.
  • FaceLight Phone demo.
  • Photoshop files (Windows Phone icon and tile). 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Vangos Pterneas
Product Manager LightBuzz
United Kingdom United Kingdom
Vangos Pterneas is a Microsoft Most Valuable Professional in the Kinect technology. He helps companies from all over the world grow their revenue by creating profitable software products. Vangos is the owner of LightBuzz Software agency and author of two technical books.
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
SuggestionFaceLight does not support multiple face detection. Pin
ASV12815-Oct-11 23:04
memberASV12815-Oct-11 23:04 
Questiondownload Pin
Member 80550313-Jul-11 10:53
memberMember 80550313-Jul-11 10:53 
AnswerRe: download Pin
Vangos Pterneas4-Jul-11 4:48
memberVangos Pterneas4-Jul-11 4:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150520.1 | Last Updated 1 Jan 2011
Article Copyright 2010 by Vangos Pterneas
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid