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).
Related posts:
6 Comments (Leave a Reply)
Hi, I was wondering if you would be making the source code available for other to check out.
I’m interested in combining something like this with an infrared HD camera, a flash based 3d engine and a large projection surface say 30′ or so to create a interactive environment.
Could you possibly make it so it tracks sudden color changes instead of light? I am looking into doing somthing of this sort for a special project.
Chris – I will look into cleaning the code up and posting it soon.
Phillip – Tracking color is one of my future goals with this. Until i get my code posted I will give you a hint at what to look for if you want to try it out yourself.
The key to a lot of this is getPixel. Once you have a bitmapData made, you can use getPixel() to grab the color from any pixel on that bitmap. Then you could figure out a general range of numbers that represent the colors you are looking for. After that just keep checking to see if its switching between the two color ranges.
Hope that helps some!
This is a great blog!
Could you please provide the sourcecode?
This is sweet! I havent checked source yet but def want to see the inner workings. Nice!