Click here to Skip to main content
Licence CPOL
First Posted 31 Dec 2010
Views 11,368
Bookmarked 9 times

Face detection in Windows Phone 7

By | 1 Jan 2011 | Technical Blog
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
A Technical Blog article. View original blog here.[^]

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)

About the Author

Vangos Pterneas

Software Developer
Freelancer
Greece Greece

Member

Follow on Twitter Follow on Twitter
I have been a student at Athens University of Economics and Business, Department of Informatics, since September 2007.
 
I mainly develop and design .NET applications in C#, ASP.NET and Silverlight, but I have also worked on J2EE, LAMP and C++.
 
Currently, I am a member of Microsoft Student Partners team and I work as a freelancer for several employers including the Institute for the Management of Information Systems and Vodafone Corporation. As a Student Partner, I have made lots of speaking engagements considering Microsoft technologies (ASP.NET, Silverlight, Windows Phone etc) to undergraduate / postgraduate students and developers.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
SuggestionFaceLight does not support multiple face detection. PinmemberASV12823:04 15 Oct '11  
Questiondownload PinmemberMember 805503110:53 3 Jul '11  
AnswerRe: download PinmemberVangos Pterneas4:48 4 Jul '11  

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.

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