MarcPelland.com
Welcome at » Getting Started with Augmented Reality / FLARToolKit

Getting Started with Augmented Reality / FLARToolKit

Optimize and Customize the Settings

Camera Settings

The camera in flash is a processor hog so you really want to limit the amount of data being run through the camera. The default settings in your project for the camera are 640 x 480 video, with 0.5 sample rate and 30 fps.

The first thing to consider is the camera’s frame rate. Do you really need 30 fps from the camera? This would be great if it didn’t cause your scene to run at 15 fps. So why have this set so high unless you are actually getting 30fps playback. I recommend playing with this setting a little bit to find a healthy compromise between the camera performance and overall scene performance.

Next are the dimensions. One option you have is to shrink all of the video in the scene to something smaller, but is that really a great thing? I mean, half the fun with Augmented Reality is that you have a big video and you are interacting with it. So just find the smallest possible size that meets your needs.

Finally, you have the sample ratio for the camera. This is a value between 0 and 1, where 0 is terrible and 1 is amazing. Tinkering with this value, I have found that around the default of 0.5 is a good balance of quality and speed so I usually leave this value alone but 0.4 or 0.45 may help out if you are REALLY desperate for speed.

Update Frequency

If you take a look in the View class, there is an updateScene function that runs every frame. One thing that I like to do, is as follows: Once I have dropped the camera frame rate I also create a timer in the view class that runs at the same interval that the camera updates at. This means that the matrix isn’t being translated at every frame.

This may result in more choppy performance, but it may also make things a little bit smoother if you are finding that you app is really chugging along. You could also play with an easing equation on you enter frame function to compensate if this creates a choppy feel to the application.

thanks,
marc

Pages: 1 2 3 4

16 Responses




  1. great tutorial, thanks for putting this together. i was going to ask eric to simplify his ecplination a little but this pretty much clears it up.
    one detail though. i’m working in flash. cs4 FP10
    1084: Syntax error: expecting identifier before assign.
    in referance to
    var patterns:Vector. = new Vector.(|>);
    /////////////////////////////from code////////
    private function init () :void {
    // build list of FLARPatterns for FLARToolkit to detect
    var patterns:Vector. = new Vector.(|>);********THIS LINE
    patterns.push(new FLARPattern(PATTERN_PATH+”pattern.patt”, PATTERN_RESOLUTION));
    pattern = patterns[0];

    any ideas? id love to get this working.




  2. ** there is a line : var patterns:Vector.<FLARPattern> = new Vector.<FLARPattern>(); that isn’t displaying properly in the code block and i can’t figure it out… replace it with this previous line.




  3. hey there,
    that line is creating a Vector of objects of type FLARPattern, using the “postfix type parameter syntax”:
    http://livedocs.adobe.com/flex/gumbo/langref/Vector.html

    not sure what the (|>) is, that’s not in my code…?

    take a look at v0.2 and let me know if there are still problems (just comment on the blog post).
    http://words.transmote.com/wp/20090327/flarmanager-v02-for-flartoolkit/




  4. hey,
    that part isn’t in my code either. what is happening is my syntax highlighter on my blog is blocking the characters… if you look just below the code area I have posted the correction.

  5. juan_carlos




    hi marc, how´re you doing? Man, thanks for the great tutorial. On one hand, I have a small issue with the FLARManager, cause i can´t seem to make it work once I upload it to a server. I get the following error:

    Error: Error #2032: Error de secuencia. URL: ../resources/flar/FLARparams.dat
    at com.transmote.flar::FLARManager/onCameraParamsLoadError()[C:\Documents and Settings\TOSHIBA\Escritorio\FLARManager\v03\src\com\transmote\flar\FLARManager.as:324]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

    But on the other hand, when I try to use your code I get a Flex Problem:

    A file found in a source-path ‘FLARManagerExample_PV3D’ must have the same name as the class definition inside the file ‘FLARManagerTest_PV3D’

    And of course, it doesnt run. :S any suggestions? maybe something I might be doing wrong?




  6. Great tutorial, I just had one comile error on line 108 of HelloFlarView.as.

    I changed the 0*000000 to 0×000000 to get it to compile.

    I just can’t get the movie to recognise my pattern – could this be a result of changing this line or jut a dodgy pattern?

    Thanks

  7. Sanjai




    Sweet! Very cool stuff Marc.




  8. This tutorial is great! I can easily understand what the tutorial want us to know or to learn. I hope many people will visit and see your tutorial on how to start with augmented reality flartoolkit.




  9. Thank you for sharing to us.there are many person searching about that now they will find enough resources by your post.I would like to join your blog anyway so please continue sharing with us




  10. Sweet! Very cool stuff Marc.




  11. Very interesting, but in the middle of this tutorial I lost the trace with those 2 links provided.




  12. Hi there,
    Really nice job,There are many people searching about that now they will find enough sources by your tips.
    Also looking forward for more tips about that




  13. I differ with most people here; I found this post I couldn’t stop until , even though it wasn’t just what I had been searching for, was indeed a great read though. I will instantly take your feed to stay in touch of future updates




  14. Hi there, I just wanted to say thanks for this informative post, can you please allow me to post it on my blog?




  15. You will also need FlashDevelop or another Actionscript editing tool. In this tutorial I am going to be compiling my code directly from FlashDevelop, but feel free to use the compiler/method of your choice.




  16. Heck yeah this is ecxtaly what I needed.

Leave a Reply

Captcha
Enter the letters you see above.