Search Unity

Question Loading a Large XR Image Reference Library at runtime

Discussion in 'AR' started by guillaume_hf, Dec 20, 2021.

  1. guillaume_hf

    guillaume_hf

    Joined:
    Jun 1, 2021
    Posts:
    3
    Hello,

    We are developing an AR application for which we fetch markers from a web server at runtime.
    We populate our XRReferenceImagesLibrary with the ScheduleAddImageWithValidationJob function, that seems to work fine, except :

    - The loading time :
    • it takes around 1 minute on iOS to load 71 markers.
    • it's faster on Android.
    - The tracking stability is not satisfying :
    • it's actually more stable with ARCore than ARKit, which is unusual.
    • the more markers we add, the less stable it is.
    • between each marker import, i wait for 4 frames, based on some recommandation from github.
    Is there a way to speed up things and improve stability ?

    We cannot control that markers delivered by the online API will pass the import successfully for tracking, can this impact the stability for other markers ? (AR_ERROR_IMAGE_INSUFFICIENT_QUALITY)

    Apple seems to say we can load hundreds (thousands?) markers without any issue.

    Perhaps we are doing something the wrong way, or reaching some limitation with ARFoundation ?

    Guillaume

    Unity 2020.3.20f1 / ARFoundation 4.1.7
     
    Last edited: Dec 20, 2021
  2. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
    To speed up load time, you can create the image library and load it at runtime as an asset bundle.
    https://docs.unity3d.com/Packages/c...-reference-image-libraries-with-asset-bundles

    Rebuilding the image library at runtime requires time and CPU overhead.

    For tracking, ARCore provides recommended practices as documented here:
    https://developers.google.com/ar/develop/unity-arf/augmented-images#best_practices

    and ARKit recommends "For best results, limit your detection image count to no more than around 100." as documented here:
    https://developer.apple.com/documen...2941063-detectionimages?language=objc#3924193
     
  3. BanzBowinkel

    BanzBowinkel

    Joined:
    Jun 17, 2015
    Posts:
    16