Thursday, March 25, 2010

Coding4Fun - Silverlight Real Time Face Detection

A while ago Clint Rutkas (yes, the guy that built the awesome MIX T-Shirt cannon) asked me if I could write an article for Microsoft's Coding4Fun site. I felt honored and of course I agreed. Today I'm proud to announce that my first Coding4Fun article was published.

The article demonstrates how to implement a simple facial recognition system using Silverlight 4’s new webcam feature. The method I've implemented searches for a certain sized skin color region in a webcam snapshot. This technique is not as perfect as a professional computer vision library like OpenCV and the Haar-like features they use, but it runs in real time and works for most webcam scenarios.

The complete source code for the article is available at CodePlex and licensed under the Ms-PL.
If you like the article, I’ll write a follow-up that might cover a more stable (better) segmentation approach, how to optimize the performance further and more.

Update 04-06-2010
The article was translated into Russian and is available at the Russian Coding 4 Fun site.

Update 04-15-2010
Updated the application to the final Silverlight 4 RTW build.


  1. Hi!Nice article!

    I'd like to know ,how can I modify your code for tracking eyebrows?I need this couse I'd like to make simple robotic face with eyebrows=)

    Thank you for answering.

  2. It would be hard to accomplish this with my simple color detection approach. You would have to search for eyebrows after segmentation. I recommend to use OpenCV for this. There's also a full managed port available. Too bad it's GPL-ed: