This examples shows how to track a color from the live video feed.
The default color is a blue tone, you can change that by clicking on any pixel in the video feed and the application will now track that color.
There are 4 parameters for the ColorTracker object's constructor; width, height, color to track and a treshold. treshold is obselete and optional.
This movie requires Flash Player 9
package examples { import flash.display.Sprite; import playground.src.video.ColorTracker; import playground.src.video.LiveCamera; public class ColorTracking extends Sprite { private var _cam:ColorTracker; public function ColorTracking() { _cam = new ColorTracker(320, 240, 0x44ddff, 10); addChild(_cam); //this is how you can get the x and y coordinates of the pixel you are //tracking as a Point object trace(_cam.publicpos); } } }
Hi, nice example of color tracking.
What colorspace to you use to match the colors (RGB, HSV, CIELab, … ). Are you using getColorBoundsRect() to extract the final region?
Greetings
Hello my name is Luis Rodriguez, I have been researching the detection of movement and now I’m researching the detection of color and movement, I would like you to see my work:
http://emedesing.wordpress.com/2010/09/13/pruebatelo-con-realidad-aumentada-y-deteccion-de-movimiento/
I wonder if you want to share your library as3 in this example with me so I can further my research, I would greatly appreciate
Hi Luis, I like what you got so far. How do you handle the movement detection? Difference in pixel matrix?
You can get all the files from here
http://servetulas.com/blog/playground_library/download/
It should be among one of the examples in there.
George, sorry for not replying earlier, just seeing your comment. I am using RGB and running through the image’s pixels to seek the color every frame.
exactly what i was looking for. but have a question .have you seen some libraries for specific object detection and its motion tracking ? like Pepsi Bottle or some thing .
thanks
Hey Raja, I have seen some demos done with Kinect where the user shows specific objects to the camera and the system learns what they are. Next time the user shows those objects, the system can distinguish between them and identify each of them. They were irregular shapes such as plush toys and random objects, check youtube for Kinect+Object+Recognition or something along those lines.