Flash Webcam Motion Tracking – Source Code
Just a quick note to let everyone know that I posted the source code requested for the webcam motion tracking that I did.
It is in this post: http://visualadvance.com/blog/?p=127
Just a quick note to let everyone know that I posted the source code requested for the webcam motion tracking that I did.
It is in this post: http://visualadvance.com/blog/?p=127
I decided my next step with the webcam was to attempt some motion tracking. After a couple nights work I managed to get something working fairly well.
The short explanation: I created a grid of squares over the webcam input, and each square is checking to see if there is a bright light under it. If it sees a bright light then it tells a green square to move to that position.
Update 12.17.08:
Here is the source code folks:
download source
This is the code for exactly what you are seeing in the video. I won’t be providing a whole lot of support for this version since I have moved past it now in the interest of improving it, and am focusing my energies on those versions (which I may be releasing at a future date).
I am going to keep on posting my explorations with BitmapData until someone stops me.
My latest iteration turns the input from a webcam (or video) into a haltone effect (an idea given to me by Brandon Breaux). The squares analyze the intesity of the color they are over. If they are over a dark color they will get smaller, and if they are over a light color they will get bigger. This naturally causes a halftone effect.
As I promised I integrated the webcam into my last BitmapData test. I also decided to add some repulsion to the mouse so that you can push the squares around, and they will eventually return back to their origin.
Furthering my explorations with the BitmapData and classes, I came up with this effect. It’s surprisingly easy to change one or two variables and have it give off an entirely different effect. I think my next step will be integrating this with your webcam.
