Webcam Difference Keying

Some of my students are working on a project where they need a photo-booth-like keying application (take snapshot with somebody out of the picture, then step back in the picture and the background disappears). I’ve been experimenting with pixelbender the last week, and created some classes that do just that.

difference_keying

Check out the example, and play around with the parameters. Please note that it works best with a background without too much detail or similarities with the person in front. Also make sure there’s enough lighting.

You can download the source files and play around with them.

3 Responses to “Webcam Difference Keying”


  • Cool Wouter!

    I’ve been experimenting with keying using bitmapdata and difference layers. However I didn’t manager to figure out how to nicely apply that difference to the actual image as a mask!

    This might be interesting! Thanks for sharing :)

  • My friend this is good, i’m learning now

  • Hey there! This post couldn’t be written any better! Reading this post reminds me of my good old room mate! He always kept chatting about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing!

Leave a Reply