FLARManager v0.5 (augmented reality in Flash)

i wear my sunglasses at night...

another upgrade, hot’n'fresh for you.
download here:
http://words.transmote.com/wp/flarmanager/

 

what is this?

FLARManager is a lightweight framework that makes building FLARToolkit augmented reality applications easier. it is compatible with a variety of 3D engines, and provides a more robust event-based system for managing marker addition, update, and removal. it supports detection and management of multiple patterns, and multiple markers of a given pattern.

 

what’s new this time around?

[adaptive thresholding]
makc and saqoosha have been experimenting a bit with adaptive thresholding, so i decided to give it a go as well. markers are now detectable in varying and low illumination — great for web apps, where developers have no control over the end user’s lighting. (the image above demonstrates this feature in action.)

[support for Alternativa3D, Away3D, and Sandy3D]
FLARManager now supports the above three frameworks, along with the existing support for Papervision3D and Flash Player 10 3D. Thanks to makc and rob bateman for their assistance with matrix and camera conversions, and to holde for help with Away3D lighting.

[tutorials and examples]
the Inside FLARManager section in the nav bar above provides access to documentation and tutorials about FLARManager, as well as links to FLARToolkit-related content. simple tutorials are now available for basic 2D, 3D, and collada applications.

[optimization]
some changes under the hood, accompanied by extensive testing and profiling, allow FLARManager to run faster and more efficiently than before. additonally, a number of features are now exposed to the developer to tweak performance on an application-by-application basis. stay tuned for a detailed writeup on this.

[FLARProxy update]
FLARProxy allows developers to simulate marker detection with a mouse and keyboard. The functionality has not changed in this version, but it can now be activated via the external config file.

 


 
below is a full list of the changes since v0.4. most of these changes will not affect applications written with FLARManager v0.4, with the exception of the change in FLARManager’s constructor (see below).

 

FLARManager constructor change

completing the move away from specifying application settings in source code and toward using an external configuration file, the path to the config file should now be passed directly into FLARManager’s constructor:
this.flarManager = new FLARManager("../resources/flar/flarConfig.xml");
if you still wish to specify application settings in source code, use FLARManager.initManual.
also, FLARManager.initFromFile is still supported, for legacy applications.

 

support for Alternativa3D, Away3D, and Sandy3D

FLARManager now supports the above three frameworks, along with the existing support for Papervision3D and Flash Player 10 3D. Thanks to makc and rob bateman for their assistance with matrix and camera conversions. use of these frameworks is subject to each of their licenses.

FLARManager comes with examples for all of the supported 3D frameworks:

  • FLARManagerExample_Alternativa3D.as
  • FLARManagerExample_Away3D.as
  • FLARManagerExample_Flash3D.as
  • FLARManagerExample_PV3D.as
  • FLARManagerExample_Sandy3D.as

 

FLARManagerExampleLauncher.as

adding more examples and tutorials created just too many runnable Application classes, so i consolidated them into one class. FLARManagerExampleLauncher.as is now the only Application class; uncomment the example or tutorial you want to run.

 

FLARMarkerOutline removed

FLARMarkerOutline was deprecated in v0.4; it is now removed completely. use FLARMarker instead.

 

FLARProxy update

FLARProxy allows developers to simulate marker detection with a mouse and keyboard. The functionality has not changed in this version, but it can now be activated via the external config file.

 

adaptive thresholding

makc and saqoosha have been experimenting a bit with adaptive thresholding, so i decided to give it a go as well. markers are now detectable in varying and low illumination — great for web apps where developers have no control over the end user’s lighting.

use FLARManager.adaptiveThresholding to toggle this functionality; it is set to true by default. adjust FLARManager.adaptiveThresholdingSpeed and FLARManager.adaptiveThresholdingBias for finer control over this functionality.

 

preliminary sample blurring

per a suggestion by jeffery bennett, frames sent to FLARToolkit for marker detection are blurred slightly before processing. this feature can be adjusted and disabled via FLARManager.sampleBlurring. thanks jeffery!

 

marker removal delay

while smoothing can help reduce jitter, slightly delaying removal of the marker can help reduce flickering. use FLARManager.markerRemovalDelay to adjust the length of time between marker removal and the MARKER_REMOVED event dispatch.

 

error reporting

by applying an ErrorEvent listener to your FLARManager instance, you can catch any errors that might arise in FLARManager’s initialization. currently, the only such error is a failure to acquire a camera.

this.flarManager.addEventListener(ErrorEvent.ERROR, this.onFlarManagerError);

all of the examples (not tutorials) demonstrate how to handle ErrorEvents dispatched by FLARManager.

 

collada tutorial

the people have asked for a simple tutorial demonstrating how to load a collada model for use in an AR app. here you go.

36 Comments

  1. technodai says:

    Yet again, great work Eric!

  2. Samurai says:

    wowwww! great work!

  3. gordee says:

    Hey Eric, I was really excited about this latest release but I can’t compile the examples without a compile time error:

    1046: Type was not found or was not a compile-time constant: FLARMarkerEvent.

    Yet the file is in the right place and the import statement is accurate. I’m stumped!
    Any suggestions?

  4. ericsoco says:

    @gordee: very strange. maybe try deleting the project (and folder contents) and starting again fresh? maybe there’s a conflict with another project or something? or maybe your project settings are somehow corrupted? not sure…but please let us know if you make any progress or find a solution.

  5. Pier says:

    Hi Eric I’m trying to compile your examples in the SVN 0,5 release using CS4 and I’m getting this error.

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at org.libspark.flartoolkit.core.pickup::FLARColorPatt_O3/updateExtpat()
    at org.libspark.flartoolkit.core.pickup::FLARColorPatt_O3/pickFromRaster()
    at org.libspark.flartoolkit.detector::FLARMultiMarkerDetector/detectMarkerLite()
    at com.transmote.flar::FLARManager/detectMarkers()
    at com.transmote.flar::FLARManager/onEnterFrame()

    I’m 100% sure but I think it happens when FLARmanger detects the patter.

    I’m using the Saqoosha flar logo pattern, and his .pat file.

    Can you help me?

    Regards

  6. ericsoco says:

    @pier — i think the null object reference it’s complaining about is the video source that it’s trying to analyze. i believe this error happens when your camera is not detected correctly (e.g. when it’s already in use), but you go ahead with the application anyway. are you seeing video?

    i don’t have this problem, but am not running in CS4. is it possible for you to turn on the debugger, and to see what value is null at the location of the error? is it the parameter ‘image:IFLARRgbRaster’?

  7. Pier says:

    After trying different versions of your manager, and the flartoolkit for a few hours… I just found out what it was…. I feel so dumb.

    In the resolution attribute of your xml I was using a wrong parameter… I thought somehow that resolution was the number of “squares” the pattern was divided by… So using the flar logo pattern I count 13 x 13…. so I used 13…

    I just put 16 and now it works. I don’t know where that number comes from, but it works.

    Sorry for the flood. I hope this info will help somebody out there….

    Thanks again Eric.

  8. ZY says:

    I had this error running FLARManagerExampleLauncher.as with the following software
    1. Away3d Flash 10 version http://away3d.com/download/away3d_3_3_3.zip,
    2. FlashDevelop
    3. FLEX 3 SDK

    FLARCamera3D.as(44): col: 33 Error: Type was not found or was not a compile-time constant: Matrix3D.

    Proposed Solution: Matrix3D should be renamed to MatrixAway3D as stated on this webpage:
    http://www.mail-archive.com/away3d-dev@googlegroups.com/msg01579.html

    Please correct me if I am wrong, thank you for your work =)

  9. ericsoco says:

    @ZY — yep, i’m aware of this, and will be updating both FLARManager and FLARToolkit once i get a green light from the FLARToolkit folks.
    do you know offhand if much of the Away3D community still uses 2.3.3, or have the majority of you moved to 3.3.3?

  10. ZY says:

    Thanks for confirming! Not that I know of, sorry. Actually I am still a user of 2.3.3 because I only have CS3 and I’m more familiar developing in that IDE rather than using Flex. I was exploring multi-marker AR at squidder’s website and I chanced upon FLARManager as well. That was when I tried 3.3.3 together with FLARManager and found that error as well.
    Looking forward to the next update!

  11. [...] Download FLARManager here. A good article on FLARManager by it’s author. [...]

  12. Shawn says:

    Couple questions:

    I have the current svn co of FLARManager and I have imported the FLARManager_v05 project into FlashBuilder beta.

    First thing is I have to add -use-network=false to the compiler arguments to avoid security errors to fun locally from FlashBuilder.

    Second is I am only seeing a black screen when running the project ( or a black screen with the green fps numbers, depending on the example being run ) I get the prompt for allowing my camera and I see a bunch of traces. I also double checked my flash players settings and it is using the correct camera. Other online sample are working.

    Am I missing something? Thanks!

  13. ericsoco says:

    @shawn, i haven’t tested FLARManager with FlashBuilder yet, but it should work out-of-the-box. it’s possible that the latest in SVN has problems (though i think it should be fine). have you tried downloading the last major release (0.5)?

    re: the -use-network=false, i didn’t even realize that was an option… i always just use the global security settings panel. in fact, the black screen could be caused by a security error that is caught and handled silently…try that route and see if anything changes.

    also, probably the simplest example to test with is FLARManagerTutorial_2D. FLARManagerExampleLauncher defaults to the Collada tutorial, which is where all of the traces you’re seeing are coming from (from within ascollada/papervision). if you use the 2D tutorial, you won’t have to wade through all of that.

    please let us know if you make any progress.

  14. Shawn says:

    @ericsoco – Tried using the global security panel, sometimes I forget about that thing. I downloaded the official release and also tried it from flexbuilder 3. No luck. I run in debug mode and see the traces, no security error shown, so I assume that is not the problem. I authorize the camera, but the light on my webcam never turns on. Its like the swf is not actually trying to use it.

    Is the svn deploy/FLARManager_v05 the same as the separate download? I’ve tried a few of the examples, but I’m assuming they should all give me the same result if the all use the same code that accesses my camera. If you have a pointer on where to start digging first, that would be appreciated. I’ll keep searching.

  15. Shawn says:

    @ericsoco – I found the problem. In com.transmote.flar.source.FLARCameraSource, it automatically tries to find a built in iSight camera:

    if (Camera.names[i] == “USB Video Class Video”)

    I am using an older external firewire external firewire iSight. It must use the same name. Is there an official way to report bugs?

    I have come across an example elsewhere the brings up a list for the user to choose from a combox, I wonder if that will be the safest way to go.

  16. Shawn says:

    @ericsoco – Sorry for so many posts, I thought it might be helpful to provide the array of names I am seeing:

    DV Video
    IIDC FireWire Video
    USB Video Class Video

    I am on a mac desktop with no built in cameras in my monitors. Honestly since I have a firewire camera in my list I am not really sure why I also have the USB one too. Perhaps one of my monitors is reporting it despite not actually having one.

  17. ericsoco says:

    @shawn — thanks for the help. FLARCameraSource defaults to “USB Video Class Video”, but rolls over to the first camera it finds if that one is not available. i’m not sure why it didn’t in your case.

    if FLARCameraSource is not able to instantiate a Camera object, it throws an error; the FLARManagerExample files (not the tutorials) demonstrate how to handle this error to provide more feedback to the end user. the examples just spit out the error to the console.

    FLARManager does not directly handle this error because i figured developers may prefer different methods of handling it. however, the error seems common enough that perhaps i should add a default dialog.

    all of that aside, though — FLARCameraSource should have just chosen your first available camera. can you please do me a favor and step through that part of the code (FLARCameraSource.initCamera) and tell me why it doesn’t fall into the i==uint.MAX_VALUE block, thereby initing the default camera? easiest way to tell is to see what the value of i is on exiting the while loop directly above. feel free to email me directly, via the CONTACT link at upper-right. thanks!

  18. Shawn says:

    @ericsoco – I will run through my debugger and send you more info.

  19. [...] this project I’ve used the following AS3 libraries: FLAR Toolkit FLAR Manager Papervision [...]

  20. cristian says:

    HI, FLARManager v 0.5 works in Flash CS4??

  21. ericsoco says:

    @cristian — sure, FLARManager works in CS4. just set FLARManagerExampleLauncher.as as your document class to try out the examples.

  22. Will says:

    Hi,
    I was testing FLARManager v0.5 wiah a DAE animation and the 3d is bein distorted. I’ve tried other FLAR engines/examples and this error only occurs here in FLARManager.

    I think it’s this code that is makin it weird: FLARPVGeomUtils.convertFLARMatrixToPVMatrix

    Any help?

  23. ericsoco says:

    @will — did you download FLARManager from the download link, or via SVN? if the latter, when did you check it out? i just finished some work in that area yesterday, possible i screwed something up. but if you got it via the DL link, there shouldn’t be any problems…

  24. Will says:

    I’ve downloaded it on 2009/08/13. And now the download link is dead at: http://words.transmote.com/wp/flarmanager/

  25. Will says:

    How can I use the old method?

  26. ericsoco says:

    oops, sorry, i broke the link with a redirect. fixed now.
    if you downloaded via that link, there shouldn’t be any problems…can you email me your source so i can take a look?

  27. Will says:

    Hi again ;)
    How can I use the old method used in previous versions of FlarManager?
    Caouse i’ve donwloaded the flar that you’ve fixed, but i’m still getting the same errors.

    PS: I’m using the example of loading DAE(Collada) Files with animation. No changes in the code besides the multiple models code that you’ve posted earlier. :(

  28. [...] update FLARManager は 2009-07-18 に v0.5 がリリースされています。 FLARManager v0.5 (for FLARToolkit) [...]

  29. Chris says:

    So I’m running your FLARManagerTutorial_Collada example, I’m running it through the flash ide, I took the code from the AS file and copied it into a new file that I’ve set as the document class(subbed the MovieClip instead of Sprite, of course). I got everything up and running, but the tracking is horrible. Even when I’m not moving the marker, the Collada model is jumping around constantly, like all over the place, not even close to the marker, even though occasionally it sticks to the marker. Any ideas what could be wrong? I changed the default downsample of 1 to 0.5 in the config file.

  30. ericsoco says:

    @chris — hm. shouldn’t have those problems, should work well out of the box. have you tried the other tutorials / examples?
    only other things i can suggest are to improve your lighting and make sure you’re not sitting in front of a wall with black and white squares in it…

  31. Chris says:

    I think it’s the same error that Will is having above. I reverted to the 04 version and the tracking problems went away. I also set the confidence to 0.8 to improve tracking even more with the 04 version and it works pretty well now.

    By improving lighting, do you mean lighter or darker? I’m in a studio with great ambient lighting here, so I’m sure it’s not the lighting. Did you perhaps code this version with low light settings in mind?(looking at the picture for this post above)

  32. ericsoco says:

    @chris — i wonder if you’re encountering problems with the adaptive thresholding…try turning it off via flarConfig.xml and let us know if that helps. (add adaptiveThresholding=”false” as an attribute to the <flarManagerSettings> node.) i’m planning to refine that feature in the next release.

  33. ZY says:

    Hi, I have another problem with Away3D and FLARManager, but I am not sure whether is it due to Away3D or FLARManager:

    Running FLARManagerExample_Away3D.as with mirrorDisplay=”true” in flarConfig.xml, I could not see the rendered cubes with the latest version of Away3D obtained using SVN.

    However, when I tried Away3D 3.3.3 or 3.4 downloaded directly from http://away3d.com/downloads, I can see the cubes properly. Running with mirrorDisplay=”false” has no issues at all for all these 3 versions of Away3D I used.

    I have also posted this issue and the FLARManager codes I used onto the Away3D google code website at http://groups.google.com/group/away3d-dev/files as FLARManagerZY.zip (where I changed Matrix3D to MatrixAway3D). Hopefully someone can help narrow down the problem as well.

    BTW Eric, the FLARManager in SVN Revision 112 still has problems with Away3D 3.3.3? Because I still had to manually change Matrix3D to MatrixAway3D for it to compile in Flash10.

  34. ericsoco says:

    @ZY — the Away3D example should work fine with the 3.3.3 swc included in the FLARManager download. i tested with both mirrorDisplay=”true” and “false”; both work properly. where did you have to change Matrix3D to MatrixAway3D? i think that might be the cause of your problems, as i’m pretty sure this is not an issue in the latest revision (or in any revision since v0.5).

  35. Guile C. says:

    Hi!

    You think in to develop support for the “Away3D lite”?

    I’ve done some tests, but I can’t brave the elements on camera and the Matrix3d.

    Thanks in advance!

Leave a Reply

Additional comments powered by BackType