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

An Intro to Color/Motion tracking 

I don’t usually like to write blog posts about other people’s blog posts. I try to create original content that people will find useful, but that is very hard to do on the web. I like to sleep, watch TV and play video games, so it’s hard keep up with all the 24/7 coders out there.

That said, I’ve been doing a ton of research and experimentation on motion and color tracking. There is a lot of good stuff out there. A lot of it useless, but along the way I came across a few key blog posts that really got me rolling. if you are trying to get your head wrapped around all of this stuff, check out these helpful blog posts:

Color Isolation
http://www.quasimondo.com/archives/000614.php
Mario Klingemann’s blog is a gold mine of info relating to bitmap data. This blog post reveals how to pick out a color range and drop the rest of the colors. I had to translate this to AS3 for my uses. I’ll release that translation soon.

Blob Detection
http://play.blog2t.net/fast-blob-detection/
Blob detection is key to dropping little pieces of bitmap data that you don’t want or to track multiple blobs of the same color. Read the post and you’ll see how it’s useful.

Motion Tracking
http://blog.soulwire.co.uk/2008/06/06/webcam-motion-detection-tracking/
This is motion tracking it it’s simplest form. This is the post I started on.  Ultimately, you may want to combine some of the above techniques with this one. Justin Windle is a cool guy and he has lots of good info on his blog that can help you with your generative art.

Edge Detection
http://blog.inspirit.ru/?p=297
I just found this one most recently. Really interesting. I don’t have a use for this now, but I will be keeping an eye on where this goes. This blog also has a lot of good info and I will be adding this one to my regular reading list.

Automated/Adaptive Threshold
http://www.quasimondo.com/archives/000690.php
http://blog.inspirit.ru/?p=310
One of the main issues when dealing with bitmap data from a webcam is the lighting conditions the user is in. Adaptive threshold analyzes the bitmap data and applies the appropriate threshold to get the best contrast. I haven’t yet dived into the code, but this look extremely useful.

And there you have it!
The best motion and color tracking blog posts to start with. I hope this help others on the same path as I am. Hopefully I will be taking what I’ve learned from all of this and releasing it in a nice tidy code package for everyone to use.

What have I been up to? 

Haven’t posted in a while. That doesn’t mean I haven’t been busy. I just recently got married, so I had better things to think about than programming. We spent a week in Bora Bora for our honeymoon. Check out the video I made in iMovie.

Around the same time, Aaron Smith and I worked on a project with our NY office. It was a good experience. Aaron wrote a good post on it, here. We also added a few new features to Guttershark, we made really good use of Xviews and Aaron added some new stuff to the Service Manager.

Also through our NY office, I will be working on new project involving motion tracking through the webcam. I’ll be posting some of my findings and experiments here. Expect a new ColorIsolation and possibly a new MotionTracking class to be added to my SVN repo after i finish the project.