FLARManager v0.7 (augmented reality in Flash)

speedy marker, andale arriba!

version 0.7 has been a long time coming; a lot of the changes in this update have been in SVN for months. just been too busy too wrap them up into an update.

download here:
http://words.transmote.com/wp/flarmanager/

also! you know i do it all for the love. but love don’t pay the bills. please consider dropping a dime my way to help me continue working on FLARManager so i can put food in my cat’s bowl.



 

what is this?

FLARManager is a lightweight framework that makes it easier to build FLARToolkit augmented reality applications for Flash. 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?

[marker motion analysis]
FLARManager now executes some simple analysis of the motion of each tracked marker. this information is used to improve tracking of fast-moving markers by extrapolating their position after they are lost by FLARToolkit, and is used to reduce model jitter by varying the amount of smoothing applied depending on marker speed. it could also be used, for example, to create simple gestural marker-based interfaces.
 
[FLARToolkit update and SVN restructure]
version 0.7 brings FLARManager more in line with the current state of the FLARToolkit repository, with branches for FTK 1.0.0 and FTK 2.5.1. the zipped distro for FLARManager 0.7 contains FLARToolkit 2.5.1; if you’re checking out via SVN and want the latest stable build, i recommend you use the FTK 2.5.1 branch.

 


 
the full list of the changes since v0.61:
 

adaptive smoothing

the amount of smoothing applied to marker motion now varies depending on the amount of motion. slow-moving markers are smoothed more, helping to ease jitter on near-stationary markers, while faster-moving markers are smoothed less, in order to maintain responsiveness at higher speeds.

developers can manipulate adaptive smoothing by setting FLARManager.adaptiveSmoothingCenter. this can also be set via flarConfig.xml, as an attribute of the <flarManagerSettings> element. smoothing at a marker speed of FLARManager.adaptiveSmoothingCenter is equal to FLARManager.smoothing. set FLARManager.adaptiveSmoothingCenter to 0 to turn adaptive smoothing off.
 
 

marker extrapolation

with marker extrapolation, fast-moving markers that are lost by FLARToolkit due to blur can continue their motion along the same speed and direction without being reported as removed. marker extrapolation continues until the marker is picked back up by FLARToolkit, or FLARManager.markerRemovalDelay frames have expired.

FLARManager.markerExtrapolation is true by default, enabling marker extrapolation; set to false to disable. this can also be set via flarConfig.xml, as an attribute of the <flarManagerSettings> element.
 
 

marker motion data

in order to accomplish adaptive smoothing and marker extrapolation, FLARManager needs to calculate information about marker motion. this information is made available to application developers for their own use, and includes:

  • FLARMarker.velocity
  • FLARMarker.motionSpeed2D
  • FLARMarker.motionDirection2D
  • FLARMarker.rotationSpeedX/Y/Z

see the asdoc comments (and the FLARManager API Documentation, once i get a chance to update it) for information on these new properties.
 
 

variable-width marker border support

FLARToolkit’s support for markers with border widths wider or thinner than 50% of the total marker width is now exposed to FLARManager. set via the patternToBorderRatio attribute of the <patterns> element in flarConfig.xml. the value is the percentage of the total marker width/height that the pattern consumes, so a pattern with 25% border and 75% pattern would require a value of "75".

FLARToolkit’s support for variable-border width markers seems to max out around 80% / 20%.

unfortunately, FLARToolkit 2.5.1 no longer supports this feature. FLARToolkit 2.5.2 will support it, and FLARManager will target FTK 2.5.2 once it is released. the FLARManager_FTK_1_0_0 branch still supports this feature.
 
 

support for inverted markers

FLARManager can now recognize markers with white borders, instead of just black borders. set via FLARManager.inverted or via flarConfig.xml, as an attribute of the <flarManagerSettings> element.

thanks to jim alliban and lee brimelow for the idea, and the PixelBender shader that makes this possible.
 
 

under-the-hood improvements and changes

  • flarConfig.xml loading and parsing now lives in FLARManagerConfigLoader.as, cleaning up FLARManager.as a bit.
  • DrunkHistogramThresholdAdapter.as is now the default threshold adapter (shout out to matt reynolds for the suggestion). as such,
  • adaptiveThresholding, adaptiveThresholdingSpeed, and adaptiveThresholdingBias have been removed.

  • display mirroring now defaults to true.

11 Tweets

35 Comments

  1. [...] La lista de cambios se puede encontrar en su blog y la descarga en la página de descarga del mismo. [...]

  2. Daniel Delgado says:

    Hi Eric… I’m working right now with this v0.7 and give some errors. In spanish sorry…

    NyARColorPatt_Perspective_02.as, Line 60 “1020: El método marcado como override debe sustituir a otro método.” (1020:

    NyARSquareContourDetector.as, Line 45 Warning: 3594: trap no es un método reconocido de la clase dinámica NyARException.

    Can you tell me what to do? please

    Thanks for all,

    Daniel

  3. ericsoco says:

    hi daniel. it sounds like you may have something weird going on in your FLARToolkit packages. try removing them completely and reinstalling from the FLARManager zip file.

  4. Daniel Delgado says:

    I delete all my folders, and reinstall all.

    I get a new error:

    FLARMultiMarkerDetector.as, Line 385 The same override error 1020…

    Will be the same bug of Flash CS4? http://www.dpdk.nl/opensource/internal-classes-confuse-cs4-compiler

  5. Daniel Delgado says:

    In this forum http://groups.google.com/group/flartoolkit-userz/browse_thread/thread/b3e72b7704c561ea I read the problem with the CS4 and FLARToolKit 2.5.1 library … and looks like don’t have any solution yet!…

    What do you recommend to me to program as3?? What are you using?

  6. ericsoco says:

    @daniel delgado — i use Flex Builder 3. but i’m behind the times; planning to upgrade to Flash Builder 4 or FDT soon. the thread you posted links to this description of the bug you’re seeing:
    http://www.dpdk.nl/opensource/internal-classes-confuse-cs4-compiler
    with a workaround to remove internal classes. but i think a better workaround is to use a different tool ;)
    (i wonder if there’s an upgrade to CS4 that fixed this bug? that post is over a year old now…)

  7. Daniel Delgado says:

    Hello Eric.
    Thanks for your help and your excellent work with this library.

    I’m using at last!! your flarManager 0.7 with FlashBuilder at the office… hehe

    Two questions:

    First:
    I have a system of markers (3) and I wish use just one for show my 3D Collada Object, and the rest for activate two animations clips.

    The system for play clips is hide one marker or another and this works great! My problem is how I can show my 3D object only over the first marker (0)? My object “jump” over the marker, always random.

    Second:
    I’m from Venezuela, and I want to buy one commercial license for my company, but in this country we have one biiig control on the dollar money (just US $300 for year to buy on Internet and I don’t have more for this year) What can I do? :’(

  8. Daniel Delgado says:

    Hello Eric

    Thanks for your soon answer, I’ll get in touch with Mark soon.

    Look… I have a problem… a “random” problem… I run the swf and I’m getting this error randomly, inside the flash player, I don’t know what is caused…

    Error
    at DetectSquareCB/onSquareDetect()[C:\Realidad Aumentada\proyectos\testpruebas\librerias\src\org\libspark\flartoolkit\detector\FLARMultiMarkerDetector.as:357]
    at org.libspark.flartoolkit.core.squaredetect::FLARSquareContourDetector/detectMarkerCB()[C:\Realidad Aumentada\proyectos\testpruebas\librerias\src\org\libspark\flartoolkit\core\squaredetect\FLARSquareContourDetector.as:140]
    at org.libspark.flartoolkit.detector::FLARMultiMarkerDetector/detectMarkerLite()[C:\Realidad Aumentada\proyectos\testpruebas\librerias\src\org\libspark\flartoolkit\detector\FLARMultiMarkerDetector.as:149]
    at com.transmote.flar::FLARManager/detectMarkers()[C:\Realidad Aumentada\proyectos\testpruebas\librerias\src\com\transmote\flar\FLARManager.as:749]
    at com.transmote.flar::FLARManager/onEnterFrame()[C:\Realidad Aumentada\proyectos\testpruebas\librerias\src\com\transmote\flar\FLARManager.as:687]

    Thanks in advanced

    Daniel Delgado

  9. Daniel Delgado says:

    The line 357 from FLARMultiMarkerDetector.as is this:

    if(!NyARLinear.crossPos(sq.line[i],sq.line[(i + 3) % 4],sq.sqvertex[i])){
    throw new NyARException();//ここのエラー復帰するならダブルバッファにすればOK
    }

    What is this NyARException? what handle it?

  10. ericsoco says:

    @daniel — i’ve come across that issue in FLARToolkit as well, and have emailed rokubou and nyatla about it. as it’s coming from a callback method within FLARToolkit, there’s no way for FLARManager to wrap it in a try-catch block; the best thing to do for now is comment out the line that throws the error. maybe put a return; statement in instead. dunno.

  11. Didier says:

    Using Flex Builder 4 and FLARManager v0.7.
    Running the FLARManager tutorial 3D.


    Error
    at DetectSquareCB/onSquareDetect()[/Users/diregui/Desktop/didier/FLARManager_v07/src/org/libspark/flartoolkit/detector/FLARMultiMarkerDetector.as:357]
    at org.libspark.flartoolkit.core.squaredetect::FLARSquareContourDetector/detectMarkerCB()[/Users/diregui/Desktop/didier/FLARManager_v07/src/org/libspark/flartoolkit/core/squaredetect/FLARSquareContourDetector.as:140]
    at org.libspark.flartoolkit.detector::FLARMultiMarkerDetector/detectMarkerLite()[/Users/diregui/Desktop/didier/FLARManager_v07/src/org/libspark/flartoolkit/detector/FLARMultiMarkerDetector.as:149]
    at com.transmote.flar::FLARManager/detectMarkers()[/Users/diregui/Desktop/didier/FLARManager_v07/src/com/transmote/flar/FLARManager.as:749]
    at com.transmote.flar::FLARManager/onEnterFrame()[/Users/diregui/Desktop/didier/FLARManager_v07/src/com/transmote/flar/FLARManager.as:687]

    FLARMultiMarkerDetector.as throws an error. Has a fix been figured out yet? Does it only happen when running FlashBuilder 4 ?

  12. ericsoco says:

    @didier — nyatla tells me that error is for debugging only and can be removed. i assume then that it will be removed in future FLARToolkit versions. i may be wrong on both these points — sometimes the japanese<>english communication is a bit shaky.

  13. isaac says:

    hello,eric. sorry for that i am a fresh on the FLAR.

    i just downloaded the FLARMananger_v0.7 and there are some error i dont konw what is that

    1. couldn’t find the declarations:cmodule.libFlareFNT:CLibInit

    i think all the mistakes are due to the lack of this file, where can i find this???

    just forgive my stupid quertion and give me some help, thx a lot

  14. ericsoco says:

    @isaac, i think you’re using a version of FLARManager that is still in production. please use the version available for download from the download page.

  15. isaac says:

    @eric, first, thank you for your soon reply

    i can run the program now, but there is a random problem, sometime it say that it cannot detect the webcam( mircosoft usb webcam), but sometimes it is ok.

    the error message is
    Error #2044: Unhandled error:. text=Camera not found. Please check your connections and ensure that your camera is not in use by another application.

    i have read the former post, and i see someone change the value of FLARCameraSource.CAMERA_VALIDATION_TIME that can fix the problem, but i try many times to change the value ,but it is no work

    is there any another issue to induce this problem???

  16. isaac says:

    hello,eric

    i have been using the FLARMangerV07 for a period, but when i run the problem, it is not very smooth, i want to know about the hardware setting, maybe can u share about yours?

    thx a lot~

  17. Eric D says:

    Hey Eric, great work.
    I have a question though. I’m trying to develop a FLAR app where I have 3 3DS models matched to 3 markers, with a different model set to appear when it’s corresponding marker appears. I would like to have it so that the models appear simultaneously when all three of the markers are visible. I have it up to the point where I can being up different models depending on the marker, but I can’t seem to get them all up at once. Any advice?

  18. ericsoco says:

    @eric d — have you tried modifying FLARManagerExample_PV3D to load models instead of just cubes? you could load all three colladas and toggle visibility of each in MARKER_ADDED/REMOVED event handlers, based on the FLARMarker’s patternId.

  19. Eric D says:

    That’s exactly what I did actually, I just can’t seem to get them appearing at the same time For whatever reason, or it if I am able to do that, they’ll originate from the same marker.

  20. Eric D says:

    Nevermind, I got it. I had to use an instance of the Dictionary Class to record the markers as they were added into view, and it works really well now.

  21. Stefano Genovese says:

    Hi Eric,

    I’m trying the v0.7 of FLARManager,
    I have a problem on tracking direction of marker, the direction property is always -1
    can help me on the problem.

    Sai dirmi qualcosa in merito

    really thanks for your contribution

  22. ericsoco says:

    @stefano — sorry, i think that direction was omitted from the version of FLARToolkit included with FLARManager 0.7. i haven’t checked to see if the newest FTK version fixed that. in the meantime, i suggest you use FLARMarker.rotationZ % 4.

  23. ds says:

    Using FlarManager to load Movieclips (.swf) on Markers NOT (.flv)

    FlarManager detect loader = new Loader();
    var request:URLRequest = new URLRequest(“someMovie.swf”);

    How Can we use function loop to transformMatrix in movieClips without PV3D MovieMaterial or planes?

  24. ds says:

    How to place a swf animation into a marker with FLARManager.

    can we load a swf into a movieclip and load the movieclip into a moviematerial on a plane?.
    But How?

  25. ericsoco says:

    @ds — FLARManager does not yet support native flash 3d, but it will soon. in the meantime, you have to apply your flv/swf to a PV3D plane. i’m not that familiar with PV3D, so can’t really help you on that end. the FLARToolkit and PV3D forums could help, though.

  26. SunnyTran says:

    Hi FLARManager team,

    I’m a student and I have tried your result . It’s great . I hope
    I can join to develop FlarManager more and more better after I finished
    researching on Papervision 3D library and AR.

    Thank you .

Leave a Reply

Additional comments powered by BackType