Augmenting reality using Flash
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 …
- Print out this marker pattern [pdf]
- You’ll need a webcam
- Visit this application
- Allow it to use your webcam
- Move the pattern in front of the webcam
- You should see a virtual cow moving with it.
References
Here are the various places where I got a lot of this information from ..
- Saqoosha’s getting started article
- Mikko Haapoja’s post on Getting Started with FLARToolkit
- Lee Brimelow’s video tutorial at gotondlearn
- FLARToolkit source and examples
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.









April 13th, 2009
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
April 13th, 2009
This is awesome! I missed your session because I had to rush off, and I regret it now. Next time.
April 13th, 2009
Thanks Narayan, glad you like it.
I enjoyed your talk as well .. will definitely check out Sahi.
April 14th, 2009
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
April 14th, 2009
First saw this tech on the GE Smart Grid site (http://ge.ecomagination.com/smartgrid/#/augmented_reality) a couple of months back – really cool!
April 14th, 2009
Tom,
Yeah, the GE guys are also using the FLARToolkit ActionScript library that I’ve used here.
Mrinal
April 15th, 2009
Nice work! If only web developers had access to web cam feeds the same way we had access to div elements…
April 15th, 2009
[...] Augmenting reality using Flash – Mrinal Wadhwa (tags: augmented-reality flash graphics visualization) [...]
April 16th, 2009
Cool, inserting an animation into a video RT: @mrinal: I’m getting a lot of requests to make the cow go Moo
http://tr.im/iZLh
May 9th, 2009
Augmented reality + collada = win http://bit.ly/tv9ec
May 10th, 2009
[...] This post was Twitted by Pastorator – Real-url.org [...]
May 14th, 2009
FLARToolkit is nice, but it’s hard to get the Collada 3D models to flash. That’s why everybody’s using the cow example: http://is.gd/zNky
June 6th, 2009
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
June 23rd, 2009
@simonw Here is one FLAR demo by @mrinal http://bit.ly/tv9ec
July 3rd, 2009
[...] 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 [...]
July 31st, 2009
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 !
July 31st, 2009
RT @mrinal Augmenting reality using Flash – Mrinal Wadhwa http://bit.ly/hwRj3
August 11th, 2009
[...] Augmenting reality using Flash – Mrinal Wadhwa: [...]