Search Unity

Vuforia detecting image twice

Discussion in 'Vuforia' started by CrustyCroissant, May 5, 2019.

  1. CrustyCroissant

    CrustyCroissant

    Joined:
    Apr 27, 2017
    Posts:
    2
    Hi everyone,

    I have a really strange issue which is kinda hard to explain. Currently I have a system where a sound is played when an image target is detected. When detected the first time round this works perfect but if i lose tracking and find it again then it seems to run the script twice and therefore plays the sound twice.
    upload_2019-5-5_22-28-25.png
    as you can see from this image^^ the debug is saying that it has lost tracking twice and found it four times. Could this just be the software recognising the image once and then doing it again once it has a clearer image of the image target? I thought that but I never have this problem on the first time of recognition.

    Any thoughts?
     
  2. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    Hello,

    The tracking loop can be unpredictable in that state transitions between target detected->target tracked->target lost->target detected can happen quickly, usually with the transition between detection to tracking taking just a single camera frame. Thus, it is possible for a target's state to transition through all these states in just a matter of a few frames. I can think of a couple of reasons why this may occur during "stable" tracking: autofocus triggering, or dropped frames from the device camera.

    Normally, the Extended Tracking feature will provide continuity such that a momentary loss of tracking will not impact the experience. However, your use of sound seems to catch these transitions.

    Which Vuforia API/s are you using to trigger the sound?

    Thanks,
    Vuforia Engine Support