Webcam Green Screen Effect w/ Pixel Bender17 Feb 2009
Click to run demo
A green-screen/chroma key effect using Pixel Bender. With this version, the live video is compared against a reference image rather than a static color. Additionally, the alpha of the output is graduated based on the color difference between the base image and the incoming video (rather than just being either 'on' or 'off').
Use the sliders to adjust the falloff curve for the alpha. Click "Reset base image" to set the base image with which to compare any further changes in the video against. You can also choose your own background image (click "Browse..." at the bottom). Works best against a solid-colored background and probably best of all with proper lighting against a green background.
When I wrote the image processing routine in pure Actionscript, it ran like a slideshow. The Pixel Bender version on a multi-core system runs about 30x faster.
Pixel Bender kernel: GreenScreenEffect.pbk