Inverted augmented reality with Pixel Bender

I had the idea that I wanted to do an augmented reality project that used a white rectangle on black instead of the usual black on white. After some discussion on Twitter it was clear that I needed to invert the BitmapData coming out of the camera before sending it to the FLARToolkit. Now there are many ways which you could do that but I decided to use a Pixel Bender filter just for the hell of it. It worked perfectly and it doesn’t seem to affect performance much at all.

You can download the full source which is just a modification of the code used in the gotoAndLearn tutorial on augmented reality. Once you go black, well you know the rest.

Lee

Comments

  1. May 8th, 2009 | 1:13 pm

    The pic alongside the statement “once your go…” is just too much ;0

  2. Fréderic Cox
    May 8th, 2009 | 2:08 pm

    Great job Lee! Now I’m wondering using a white border does this mean the marker is more or maybe less influenced by lighting? Any idea?

  3. May 8th, 2009 | 4:07 pm

    Yeah, can we turn this into a caption contest?

    I don’t have anything funny to add but I have faith in Lee’s readers.

    =Ryan
    ryan@adobe.com

  4. May 9th, 2009 | 11:51 am

    ….You’ll need a wheelchair?

  5. Jeff
    May 9th, 2009 | 1:57 pm

    Next up: a pixelbender filter that makes the 3D content fit in with the low image quality of most webcams (spotty colors, weird light, unsharpness, slight stubble etc).

  6. Hicham
    May 9th, 2009 | 4:36 pm

    Hi every one,
    Lee proposed a course on Flash Player 10 at lynda.com

    check it here: flash player 10

  7. ooaps
    May 10th, 2009 | 2:55 am

    hi thanks for all but i have a question how import object who move?
    excuse i m french and i hope you understand…..
    in fact i have some little anime on 3dsmax but when i export my obj is not animated did yu know how to do thid!!!!
    Thanks a lot for yur tut

  8. May 10th, 2009 | 6:36 am

    [...] running and see the changes live also it’s really easy to use! The second tutorial is aobut Inverted augmented reality with Pixel Bender. Tell me what you think! :) Kuba digg_url = [...]

  9. May 10th, 2009 | 10:24 am

    Some possible captions:

    “oh shit, Qbert just fell off”

    “woah Son!, never point a loaded papervision+pixel bender at anybody!…you could put an eye out”

    “woah..just in time!, the Bouncing Black Boxes of Doom almost got you!, down boxes, down I say!

  10. Michael
    May 10th, 2009 | 1:51 pm

    I’m trying to get the source to run out of Flash rather than Flex but can’t seem to figure out how to replace the Flex embed code..

    [Embed(source="FLARparams.dat", mimeType="application/octet-stream")]
    private var params:Class;

    into Flash friendly code that could be used to feed the params and the params …

    e.g. fparams.loadARParam(new params() as ByteArray);

    Any help would be much appreciated.

    Thanks for the great tutorials.

  11. May 10th, 2009 | 10:40 pm

    [...] Visit Article [...]

  12. fransua
    May 11th, 2009 | 2:29 am

    When I access this page

    http://ge.ecomagination.com/smartgrid/#/augmented_reality

    And choose the “launch wind turbine”

    it just make crash my navigator (mozzila, internet explorer and google chrome)….

    Any clue ?

  13. May 11th, 2009 | 5:12 am

    [...] bender http://theflashblog.com/?p=984 Possibly related posts: (automatically generated)24/09/200910/04/20097/05/2009LOTD for April 21 [...]

  14. May 11th, 2009 | 9:39 am

    you’re like a crazy. nobody can imagine it ever. thanks for share your research. []’s

  15. May 11th, 2009 | 1:14 pm

    it’s a good example… but i don’t see A.R. with away3d, just Pv3d…

  16. Freddy
    May 11th, 2009 | 8:38 pm

    yeah, it would be great to have a Flash IDE friendly code example, and even better a simple “on the timeline code” example, not just one main document class AS, there are users working on Flash IDE, not everything in life is Flex :)

    and as usual, great tutorials and examples Lee!

  17. Al
    May 12th, 2009 | 6:22 am

    not everything is in flex, but if you get a good handle on as3 you should be proficient to write in both flash and flex…

  18. Arnie
    May 13th, 2009 | 1:18 am

    Well, not so long ago my friend shows me a clip for MINI’s AR Ad. eversince, i have been into this new super cool IT stuff. I am current working on Flash & 3dmax and i would like to ask if i make animation in Flash….How do i export to make augmented reality with registed pattern to hold em up on Camera like you do…Thanks

  19. Ed
    May 25th, 2009 | 10:53 am

    hi there,

    just to say thanks for the tutorial…but err…it didn’t work for me, i used flex and all that but i get an error saying
    An internal build error has occurred. Right-click for more information. and in the end i found that this is a bug regarding having empty curly braces {}, yet i haven’t managed to find them except in catch(e:Error){}
    and the browser page just goes grey

    anyway if you have any tips would be great
    thanks
    ed

  20. July 5th, 2009 | 8:04 am

    Thanks Lee, that’s so cool! I just finish to record a video for all my students here in Rio, Brazil.

  21. July 5th, 2009 | 1:52 pm

    I’m sorry Lee, but i tried to play your files here and the video isn’t smooth like the GE Project. It’s too slow! Any suggestions?

    Thanks

  22. James
    October 6th, 2009 | 2:48 pm

    Hi Lee, once again, a great and useful tutorial… Keep it up!

    I want to work on Augmented Reality and Motion Detection in AS3.

    But I haven’t bought a webcam yet. I need some suggestions.

    Which webcam would be best for this purpose? I don’t want to compromise on the frame rate and quality. I want it to work as smooth as possible…

    so give me some suggestions… thanks

Leave a reply