Webcam Face detection demo: Now with source!

So a little while ago, Halloween in fact, I threw together a demo of some face-detection stuff I’d been looking at. [Check out the original post here.]  We originally had the demo on the MMT Digital homepage, but recently that’s been updated and my demo got lost in the process, so I’ve restored it here, along with the Flex project for it.

Augmented Reality Halloween

So, here it is: the live demo and underneath, a link to the source code for it.

The code itself I’m not going to try explaining, but it’s a hack of other demos that are out there on the web.

Download the Flex project now.

,

About James

James is a Senior New Media Developer at MMT Digital, and has BA(Hons) in Design for Interactive Media from the University of Gloucestershire. He loves designing and producing all sorts of website and Flash-related things, as well as prattling on about technologies.Day-to-day he works with Flash, Dreamweaver, Director, Microsoft Office Sharepoint Server 2007 (MOSS) and in his spare time he mucks about in Flex and Wordpress.Follow James on Twitter.

15 Responses to “Webcam Face detection demo: Now with source!”

  1. james 7th June, 2010 at 7:29 am # Reply

    hi. I can’t see nothing in the example and flex project.
    I check the configuration but still the same. can you help me?

  2. James 7th June, 2010 at 6:41 pm # Reply

    @james – Can’t see anything as in camera feed? If you’re on a Mac it might be that this example has out-of-date camera detection – Macs tend to get confused with cameras in Flash, and the code might be only picking the first camera in the available cameras list.

    I shall try getting the code on GitHub and seeing if there’s a fix to be made…

  3. james 13th June, 2010 at 3:03 am # Reply

    hi

    thanks for your attention, but my operating system is Windows 7. The strangest thing is that I does not like in your site, but if it works to a friend.

  4. James 14th June, 2010 at 10:14 pm # Reply

    @james – Not sure what’s up there then!

  5. kacrut 25th March, 2011 at 9:39 am # Reply

    can this marilena work with XML data? How?

  6. Norman 21st February, 2012 at 1:17 am # Reply

    Hi. I would like to use your code for make a change with the mask, but I don´t know how to open the file….which is the program I have to get to modify your project??? I use Flash Cs 5 but I think it isnt the correct program

  7. James 21st February, 2012 at 10:04 am # Reply

    The project is originally a Flex Builder project file (now Flash Builder). You should be able to extract the contents from Zip format to access the code, however.

    • Norman 22nd February, 2012 at 8:11 pm # Reply

      Thaks a lot!

      But when I import the project the program show me thsi message “Application “src/WebcamFaceDetector.as” does not exist. It might have been deleted.” what does it means. Is it incomplete the project???

      Pleeeease help I need to run that project

  8. Norman 22nd February, 2012 at 10:25 pm # Reply

    Finally I can edit the MASK but now I have another doubt. How can I put an kind of ANIMATED MASK like a GIF. I already made tests with gifts but it only appears the first image. not the secuence.

  9. James 23rd February, 2012 at 10:02 am # Reply

    Unfortunately, the default Flash components only support non-animated GIF images, which is why it isn’t playing. You could replace the Image class with ByteArray.org’s AS3GIF class (http://code.google.com/p/as3gif/) however, which does add support for animated images.

    • Norman 23rd February, 2012 at 1:48 pm # Reply

      Could you make the change please? and send me or post the modify project? Pleeease.
      If you want, I could pay for the work…

      Apology for the inconvenience = )

  10. Louis 12th March, 2012 at 4:08 am # Reply

    @James, I’m wondering whether it’s possible to detect multi-face with your facial recognition function?

  11. Louis 12th March, 2012 at 4:08 am # Reply

    @James, I’m wondering whether it’s possible to detect multi-face with your facial recognition function?

  12. James 12th March, 2012 at 10:13 am # Reply

    @Louis It’s definitely possible – it might even be supported at the moment, or it’s easy to add. Certainly some of the early prototypes had that functionality in there as standard – you just have to tweak the code that evaluates face matches and face dimensions, when you’re working with a wider camera angle.

  13. Karolina 6th April, 2012 at 6:22 am # Reply

    Hi James,

    This may seem like a far stretch, but would you know how to start/stop music based on facial detection?

Leave a Reply

Note: This post is over 2 years old. You may want to check later in this blog to see if there is new information relevant to your comment.