Main page Projects Workshops About Nastypixel

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.



Flash source filedownload 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.

BakBako
Click to play BakBako

19 Responses to “Flash Motion Tracking”

  1. victor Says:

    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

  2. Henryk Says:

    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.

  3. Steiner Says:

    Henryk Hello.
    Thanks you for the post, please look at scene 2 (named tracker) for the code.

  4. jovel Says:

    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.

  5. Matthew Says:

    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!

  6. Flash8Ball Says:

    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?!

  7. Radi Says:

    Very cool work guys!, any chance to see a .fla source file of SmartRetina ?

  8. Playful Presence » Blog Archive » Trail Messenger v1 Says:

    [...] 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. [...]

  9. John Anagnostou Says:

    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

  10. hgoodsir Says:

    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

  11. Dragon's Weapon Says:

    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^^

  12. largefarva Says:

    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

  13. hgoodsir Says:

    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

  14. neuro productions Says:

    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 :)

  15. Steiner Says:

    Very cool neuro!
    I like your game , played it on NG.
    Jolly good show!

  16. Fernando Says:

    nice work! wondering where is the scene 2, it’d be nice to see the code?

    Gracias!

    F/

  17. Adam Says:

    Amazing example!
    thanks for sharing the code, it might be very helpful for a project i am sketching!

  18. Steiner Says:

    Please share a link to the project

  19. Ann Says:

    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.

POST A COMMENT