Color Tracking 

Here are the results so far for my color/motion tracking project. Turns out that you don’t have to use a difference filter when tracking colors. All you basically have to do is isolate a color range using multiple thresholds. Then run getColorBounds to get the coordinates of the color blob. The one thing I do have to add is blob detection, but with vibrant colors I don’t seem to need it.

Click on the image below to launch the swf. You can use the sliders to adjust the image for your lighting conditions. Click on one of the boxes to assign the colors to the channel. Check out my blog post prior to this one to see where I did most of my research. I’ll release abstracted code after the project is complete.

UPDATE: Source code now available here!

colortracking

Math and Flash 

For a while now I’ve been thinking about the barriers preventing me from doing cooler, more awesome visuals and interactions. I’ve come to the conclusion that what is missing is rudimentary trigonomic and geometric principles in my development approaches. So, I am going to do  something about that.

My first step is to conjure up all those things I learned (or should have learned) in high school/early college that I thought I would never use again in my life. I started with these two:

  1. The Pythagorean Theorem
  2. The Law of Cosines

Using these you can easily find distances between two DisplayObjects and the degrees to rotate a DisplayObject to point at another DisplayObejct. Basically you are creating imaginary triangles and using math/code to get the properties of that triangle.

Here is what I came up with. The triangle (movable by keyboard) will always point at the reticle/crosshair (which follows the cursor). Click to shoot. I now have the beginings of a Geometry Wars style game. Next step is collision detection and then fractals.

pointer.jpg