google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.98k stars 1.22k forks source link

Augmented Images gets confused and keeps tracking the wrong image after fast image swap #779

Open shliama opened 5 years ago

shliama commented 5 years ago

SPECIFIC ISSUE ENCOUNTERED

If you quickly swap between two different images, both old and new AugmentedImage instances may have TrackingMethod equal to FULL_TRACKING and worse than that, the old AugmentedImage Anchor will update its position according to the new image.

VERSIONS USED

STEPS TO REPRODUCE THE ISSUE

  1. Basic Augmented Images setup with at least 2 different images in the database
  2. Open the two images inside the browser on different tabs, so you can switch between them in 1 click (size/position of the images is the same/similar)
  3. Direct the phone camera at the first image, get it recognized so the TrackingMethod equals to FULL_TRACKING
  4. Switch the tabs, so now the first image is completely gone and the new image is visible
  5. Notice that now there are two AugmentedImage instances that have TrackingMethod equal to FULL_TRACKING
  6. Time passes, but the old image still there, with TrackingMethod equal to FULL_TRACKING
  7. Try to move the phone/image, notice that first image Anchor changes its position according to the second image (however, the first image is long gone) - basically, both Anchors follow the second image.

P.S. Testing this on iPad, I've managed to reproduce this case once even with a completely random image, that wasn't in the database. I just quickly swapped the tracking image for a random pic from Google Search and the Anchor position continued to track the iPad position & rotation for a few seconds, however, there weren't any images to recognize anymore. After a few seconds, ARCore figured out that the old image isn't there anymore and stopped the tracking.

The OG issue worries me much more because it's way too easy to reproduce and in my case (a book with images to recognize on each page) it might affect the user experience.

WORKAROUNDS (IF ANY)

Don't confuse ARCore by swapping between images in a quick manner 🤔

krispatl commented 5 years ago

I'm having a similar issue, in my case tracking stops anchoring on the image.Centerpose and attaches image visualizers to the camera arbitrarily. I'm in them middle of a museum install so this is an unfortunately timed update. any solutions would be greatly appreciated

krispatl commented 5 years ago

I would be happy to share my controller and visualizer which have only been altered to include a visualizer dictionary.

gom1 commented 5 years ago

Experiencing the same issue on my end. Even with just one image loaded in the database. The anchors update to whichever image I update the screen with.

krispatl commented 5 years ago

My solution was to revert back to 1.8

shliama commented 5 years ago

Apparently, it's now a “known behavior“ according to the documentation

wat