ImageAnchoringSource from URL

Hello, I was wondering how I can initialize an ImageAnchoringSource using https://developer.apple.com/documentation/realitykit/anchoringcomponent/imageanchoringsource/init(_:)

When I construct one using a URL, it doesn't seem to be tracked and I see in the following when I debug print the component:

    ▿ 0 : AnchoringComponent
      ▿ target : Target
        ▿ referenceImage : 1 element
          ▿ from : ImageAnchoringSource
            ▿ url : Optional<URL>
              ▿ some : file:///var/mobile/Containers/Data/Application/D1126EA0-A1D7-468F-A40C-8578B7F5BDDF/Library/Caches/CodeCache/0E457AA7-2195-48B9-9DD4-58CEB9397F69.png
                - _url : file:///var/mobile/Containers/Data/Application/D1126EA0-A1D7-468F-A40C-8578B7F5BDDF/Library/Caches/CodeCache/0E457AA7-2195-48B9-9DD4-58CEB9397F69.png
                - _parseInfo : nil
                - _baseParseInfo : nil
            - name : nil
            - group : nil
      ▿ trackingMode : TrackingMode
        - trackingMode : 2

Is there a specific format for the parseInfo?

When I use the same image to make an image anchoring source by group and name in AR Resources, it is tracked.

Thank you!

Hi, Can you show how is this URL constructed? Is it a local URL or remote URL? This API uses the TextureResource API under the hood so remote URLs won't work. The parseInfo fields shouldn't matter for this.

There is a also a known bug around this new API that would greatly impact the tracking quality (just the url one, not the group name one). Which may be what you're observing. But that would only impact the quality, basic detection should still work. Maybe try a simpler image loaded from the main bundle and see if that's functional.

ImageAnchoringSource from URL
 
 
Q