hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.16k stars 398 forks source link

[bug report] Multiple Tracks doesn't work with same target index #301

Closed marcusx2 closed 1 year ago

marcusx2 commented 1 year ago

If you take this example, and change the targetIndex from the second image target entity from 1 to 0

BEFORE
<a-entity mindar-image-target="targetIndex: 1">
        <a-gltf-model rotation="0 0 0 " position="0 -0.25 0" scale="0.05 0.05 0.05" src="#bearModel" animation-mixer>
      </a-entity>
AFTER
<a-entity mindar-image-target="targetIndex: 0">
        <a-gltf-model rotation="0 0 0 " position="0 -0.25 0" scale="0.05 0.05 0.05" src="#bearModel" animation-mixer>
      </a-entity>

and try to track 2 raccoon images, it won't work. The scanning visual disappears, indicating that the raccoon images were detected, but no models showed up. I expected 1 raccoon to show up on top of one of the raccoon images, and 1 bear to show on top of the other raccoon image.

Maybe it's not a bug and works as intended, but it really seems like a bug since it looks like the raccoon images were detected, the models just don't show. Besides, if it's working as intended, can't you change so that multiple image targets of the same target index can also be tracked? I don't see why this can't be done.

@hiukim Please clarify if this is intended behavior and if it will be changed or not. Thanks!

marcusx2 commented 1 year ago

I can make it work if I compile the raccoon image twice and still use targetIndex 0 and targetIndex1 instead of having 2 targetIndex 0 image

Maybe it's by design after all, although a bit counter-intuitive and wasteful. If I want to track multiple images that are all the same, I need to compile it multiple times.

hiukim commented 1 year ago

It's not really a bug, but It is simply not able to track multiple instances of the same targets.