Face-tracking with Flash

At work we've done several projects that involve facial tracking of some sort. While we're still mostly a Flash shop, when it comes to facial recognition, we've been relying on C and C++ apis to get the job done. Today I decided to start looking into an ActionScript solution and the results so far have been promising!

It started when I saw a forum post on ActionScript.org about facial tracking. Someone was looking into using a library called deface, which can be found on google code. I downloaded the source and examples, but I was having trouble compiling them. I soon started looking for another solution and I came across Marilena in the Spark Project. A little more digging lead to this post on Mario Klingemann's site which contained a slightly modified version of the original Marilena code. Mario created a sample application that used the Marilena code for facial recognition from a webcam feed which is almost perfect for what I want to do; it just lacks the finer precision I'm looking for.

The application detects faces and draws a rectangle around the whole face area, but it doesn't distinguish individual features such as the eyes, nose, or lips. For now, I just threw in some simple code to track the user's nose. The results of this are shown in the video below.

Right now the code isn't truly tracking the nose; I just put the pig nose overlay in the middle area of the face detection box, but it seems to work well enough for simple purposes. I do plan on looking into this more and have an idea of where to go next. The Marilena code uses something called haar cascades for detection. It looks like creating these is no simple task, but luckily others have already done it so at some point I'll look into integrating cascades for specific facial features and improve the tracking.

The source code is available for download here. Please note that I did not write most of this code. The original Marilena code was written by Ohtsuka Masakazu; and as previously mentioned, the modified version I used came from Mario Klingemann's blog. I only made slight additions and modifications in order to work in the pseudo nose tracking.

Bookmark and Share

3 Responses to “Face-tracking with Flash”

  1. Luis Rodriguez says:

    Hola Rhuno te comento que yo tambien trabaje con marinella :
    http://emedesing.wordpress.com/2011/01/13/deteccion-de-rostro-flash-as3/
    y si pues no es tanto como lo que uno esperaría, pero encontre otra librería que debes probarlo , te lo recomiendo :

    http://emedesing.wordpress.com/2011/07/08/probando-libreria-de-face-tracking/

  2. Rhuno says:

    Wow, very cool, Luis! Nice work on the face tracking stuff and I will definitely check out the library you suggested! Gracias! =-)

  3. [...] yesterday's post, I showed a simple example of how to do some very basic facial tracking using the Marilena code [...]

Leave a Reply

Subscribe to RSS feed