Hello Everybody!
This is just an afternoon proof of concept I made for a project that needs this feature. The mission of this development is to extract the people in front of the camera, and although the extraction must be improved widely, you can see below the first results
In order to achieve this I used flash and Pixel Bender. The algorithm to achieve this results is mine and probably for that reason is not very optimized
What I do, basically is retrieve the absoulte values of the RGB channel substraction between the empty room image values and the camera stream, then I compare the average of this result with the tolerance and if is inside the ratio, Bingo! just render it!
Problems I found doing this POC:
- Lack of Pixel Bender documentation, although I finally found what I need.
- When you take the first screenshot and then you seat in front of the webcam, you may provoque some changes in the lights of the room, this has as a result some rendering problems, but most of them should be solved adjusting tolerance.
- You shouldn’t wear any color that is at the same time in the first picture ( the one without you )
- Poor quality webcams generates more pixeled renderings, that can be solved on the flash side, smoothing the webcam stream, and on the pixel bender side improving the algorithm.
- Poor quality webcams adds an odd ‘stroke’ surrounding the user silhouette
Actionscript tips:
To link the Pixel Bender images to the Actionscript code use this:
_shader.data.frontImage.input = image1BitmapData;
_shader.data.backImage.input = image2BitmapData;
*frontImage and backImage are the names set inside Pixel Bender Code.
To run the Pixel Bender Job you must create a new BitmapData with the same size of the input images, and render the result there with the next commands:
var myJob:ShaderJob = new ShaderJob( _shader, outputBitmapData );
myJob.start(true);
Pixel Bender:
Here you can get the Pixel Bender Code.
A new question came into my mind, if I can send a ByteArray to Pixel Bender and get a modified one, and, Strings can be converted into ByteArrays, can Pixel Bender be used as a Encryption method? I’ll investigate…
Sure someone already try that
I already tried this using alchemy seems the link is broken, I will try to restore this post soon
No related posts.

It‘s quite in here! Why not leave a response?