Augmenting reality using Flash

April 13, 2009

I gave a talk about Augmenting Reality at Devcamp Bangalore this Saturday. In the talk I did some live coding to show how you can use Saqoosha’s FLARToolkit AS3 library to add 3D objects to a webcam video in real-time … here’s a video recording of the application we created during the session … it adds a cow to reality ..

The core idea behind FLARToolkit (which is an AS3 port of ARToolkit) as I understand it … is that it can detect if a given pattern is present in a bitmap, if so .. then where is it located and how much has it been transformed in 3D space. Once we have this information .. we can manipulate the bitmap (or a frame of video from a webcam in our case) to add virtual objects that can be moved and transformed same as the pattern. If this is done over each frame of the movie coming from the webcam it creates the illusion of a real object being added to the video and the object moves around as we move the pattern in reality.

Here’s the code with detailed comments on how this is achieved … You can download the complete project here.

Try it out yourself …

  1. Print out this marker pattern [pdf]
  2. You’ll need a webcam
  3. Visit this application
  4. Allow it to use your webcam
  5. Move the pattern in front of the webcam
  6. You should see a virtual cow moving with it.

References

Here are the various places where I got a lot of this information from ..

I hope everyone who came to my talk enjoyed it .. I would love to hear any feedback that you may have.

Also a very special thankyou to the all the guys who were behind organizing Devcamp, I had a great time and learned a lot.

13 Responses - What do you think?

  1. I forgot to mention that I got the cow collada model from the Papervision2.com blog http://papervision2.com/loading-complex-models/ .. thanks to whoever shared it there :)

  2. This is awesome! I missed your session because I had to rush off, and I regret it now. Next time.

  3. Thanks Narayan, glad you like it.
    I enjoyed your talk as well .. will definitely check out Sahi.

  4. hey I am from delhi
    I wish could have been there
    I am really impressed by the papervision and now the kinna demos we have “the Augmented reality”
    gr8 wrk looks awesome
    nikhil

  5. First saw this tech on the GE Smart Grid site (http://ge.ecomagination.com/smartgrid/#/augmented_reality) a couple of months back – really cool!

  6. Tom,

    Yeah, the GE guys are also using the FLARToolkit ActionScript library that I’ve used here.

    Mrinal

  7. Nice work! If only web developers had access to web cam feeds the same way we had access to div elements…

  8. [...] Augmenting reality using Flash – Mrinal Wadhwa (tags: augmented-reality flash graphics visualization) [...]

  9. [...] This post was Twitted by Pastorator – Real-url.org [...]

  10. hello i’m very interrested of your post about augmented reality
    and i wish do a project like your project but i can’t do so because i haven’t a big idea of what shoud i have as softwares… so can anybody help me to do so ??? thanks a lot

  11. [...] charlas sobre Pixel Bender, Realidad Aumentada (Aumented Reality) explicando la libreria japonesa flartoolkit, utilización del comando de la Wii en AS3, uso Phidgets desde AS3, AIR, etc (revisen los links si [...]

  12. man, i got your project for test, but when i my DAE appear in screen without a texture… what can be wrong? i don´t change anything…

    tks !

Your thoughts or questions: