Flash Motion Tracking
A Guide by Yaniv Steiner.
NOTE: Before you read and download the source file FLA take a look SmartRetina project controlling GoogleEarth
Using the new Flash BitmapData functions I started my exploration in order to achieve a fully controlled interface feeding on the user hand movement opposing to keyboard, mouse or joystick. The idea is to use pixel data from the WebCam and analyzing it by comparing old and new snaps to locate movement. So far I saw very little examples of tutorial or real use.
download the source file (.fla)
BakBako – flash 8 motion tracking game
At this point of my exploration I manage to create a small game that will demonstrate some of my insights regarding my real focus: Interactive games using a WebCam. I do believe that controlling a game with only your body movements and without using elements like mouse or keyboard can give a different “feeling” and better (or more fun) use of computer games as we know it.
keywords: BitmapData class, Blendmode, Geom,Edge Detection.

January 18th, 2006 at 4:45 pm
podria usted enviarme el codigo fuente para echarle un vistazo?, es que quisiera hacer algo parecido, pero no doy con la tecle, un saludo y gracias de antemano
May 9th, 2006 at 4:26 am
It works quite good. I’ve got just one question. Where is the code? I’ve opened the file and everything works, but how can I use it, if I don’t even find the code. I would like to precise it for my project and find ways to use the position information. Am I to blind to see it?
Thanks and keep on, you’re doing great works.
May 9th, 2006 at 10:36 am
Henryk Hello.
Thanks you for the post, please look at scene 2 (named tracker) for the code.
June 5th, 2006 at 3:30 pm
This is great!! I got an idee for you.
Is it possible to make an object zoom in and out by moving your hand towards or away from the webcam? I am not programmer but i have some idee’s for the code that it needs :
When you moving your hand ( or somthing else ) closer to webcam it will become bigger on the webcam. So it wil use more pixels. So, if the object that is moving is using more pixels than the previous one, then the webcam nows it is closer near it. This means it will zoom in the object on the screen.
July 31st, 2006 at 8:26 am
Hi, that is fantastic, but I have one slight problem would you be able to convert it to Flash MX and send it to me? Thanks!
September 10th, 2006 at 10:45 pm
Yo Matthew.
I really don’t think it can run as flash MX,
webcam interaction is only available from version 8 and above.
why not donwloading the trail version from Macromedia website?!
September 10th, 2006 at 11:15 pm
Very cool work guys!, any chance to see a .fla source file of SmartRetina ?
November 5th, 2006 at 11:29 am
[...] So after an awesome 5 minute skype-storm with Yaniv, I decided to first try prototyping the Trail Messenger with video tracking. I am using Yaniv’s awesome work on computer-vision/motion tracking with flash’s new BitmapData API with a webcam. [...]
November 8th, 2006 at 3:48 pm
I was wondering whether it would be possible to use the motion display demo as a starting point for a simple webcam based interface, like triggering “mouse overs” in certain areas of the screen, but i guess it need a kind of collision detection, or a coordinates reader.I m more speculating, since my knowledge of scripting is basic, but i can understand the process and i guess you have a more hands on opinion!
Cheers
November 23rd, 2006 at 2:36 pm
i downloaded the source file, but have no idea where to start i would like to make a game like bak bako…… are there any source files or tutorials
December 10th, 2006 at 4:43 am
The source file may be hard to download but it gives a hard smile for everyone like me^^……Bak bako is the game that i was playing during the end of my class(because the other games are boring)
Are there tutorials because i’m always in trouble when playing bak bako^^
December 18th, 2006 at 3:31 am
The motion tracking doesn’t work for me, and I have a webcam, and I turned it on. It still doesn’t work. By the way, I am on Mac, so tell what’s wrong, please
December 18th, 2006 at 5:37 pm
Thank you !
Your Code got me off to a great start it took me three weeks to understand how it works and i have written my own, i have now created my own game…….
peace out
January 14th, 2007 at 2:52 pm
Thanks for the source.
the game I created with it is a huge success (almost more than 100.000 views on newgrounds)
You can find it in my site.
thanks again
January 24th, 2007 at 2:05 am
Very cool neuro!
I like your game , played it on NG.
Jolly good show!
January 25th, 2007 at 9:36 am
nice work! wondering where is the scene 2, it’d be nice to see the code?
Gracias!
F/
February 19th, 2007 at 5:06 pm
Amazing example!
thanks for sharing the code, it might be very helpful for a project i am sketching!
May 4th, 2007 at 2:05 am
Please share a link to the project
May 29th, 2009 at 1:33 pm
Hi, I love this project of yours.
I was wondering if there is a possible way where I could turn off the webcam feed display. so that it looks like im just moving the object.