WebXR Image Tracking - Allow tracking of only one Image Tracking

Hello all,

I am using the WebXR image tracking feature and I have been wondering whether I can have only a single tracked image active. Basically I am tracking more than 10 images and when there are more than 2 tracked images, things are rather slow on my mobile device.

Btw, such a feature is not supported currently by babylon.js and the current API WebXR Image Tracking marker-tracking/explainer.md at main · immersive-web/marker-tracking · GitHub

So, I was thinking how we could implement such an approach. For example we could allow only one image with state “tracked” being tracked, and keep it as long as its state is “tracked” or it is “emulated” and there is no other “tracked” image, and by deactivating any images that have their state “emulated” when there is one with state “tracked”.

What do you think?

I guess the main question is what is causing the low perf. If it is the underlying system (i.e. android itself trying to track those images) then there is little to nothing we can do. It would be great if the webxr API would allow us to add and remove trackers when needed, but ATM you can add images before the session started.
If the perf is low because of babylon itself it is something we can solve, or even you in your implementation. But I assume it is more of an android issue, right?

Thanks for the quick reply!

Yes, it seems that the major bottleneck is the multiple Images tracked by the AR services. Tracking two images adds statter to my AR world, even without rendering anything on top of the tracked images.

My app also uses the DOM Overlay Feature to display on top of the tracked images custom HTML content, so the performance is getting even worse.

However, supporting this use case seems rather useful. Do you know if we can change the state of the tracked images. Can we change the state of the tracked images in the XRFrame?

Added an issue to github Setup session for single image tracking / Stop tracking image · Issue #13 · immersive-web/marker-tracking · GitHub

trackingState is a readonly variable that is provided to explain the state of the tracker, but not to change it. AFAIK there is no way to change the marker/image’s state when a session is running. It is an open issue on the webxr marker tracking repo - Adding tracked images with running session. · Issue #2 · immersive-web/marker-tracking (github.com). ARKit does not support this, though I am not sure why we are even considering ARKit in this case, as apple haven’t even made a single WebXR API available in Safari.