Start a new topic
Solved

WikitudeCamera frames drop when disabling ImageTracker while tracking is active

SDK  : Wikitude Unity Pro SDK 9.6. Reproduced on 9.12.

Unity  : 2020.3.2f1


Hello,


We are facing the same issue from this already existing ticket : https://support.wikitude.com/support/discussions/topics/5000095613

On Android (not in the Editor), if the ImageTracker is currently tracking an image, and we disable the ImageTracker, then the camera frame rate drops significantly.

The last response on the previous ticket was "I could reproduce the issue and it indeed seems like an issue in the SDK. We will fix it in an upcoming release."


This was 2 years ago, and we tested on the latest SDK 9.12 and the issue still exists.


Do you have plans to resolve this issue ?


Best regards


Hello Team Thales,


glad to hear you found a workaround for your use case. I really like how you solved it, to be honest.

I've talked to the development team regarding this. They told me that they're not planning on solve this bug since it only affects the Professional Edition (PE), which we're planning to deprecate in near future. Also this behavior does not affect the Expert Edition (EE) which will be the product that will supersede the PE.

Currently we're still waiting to release the version 9.13 of our SDK which adds a lot of PE's features into EE. Unfortunately this has been delayed for a couple of weeks now due to legal reasons. But once

it's available we would recommend to try it since its more stable than the PE version.

With best regards,
Peter

Hello,


Thank you for your answer.

You are right that we can switch between ImageTracker and InstantTracker with no problem.


We still had an issue with "disabling the Camera component" :

- As you said, this won't actually disable the tracking but doesn't display it anymore.

- Since we use Extended Tracking, the tracking will not stop even if the user remove the image from the camera vision. If the user wants to enable ImageTracking again, it will immediately show the "previous" tracking state (which actually never stopped). The expected behavior from a user point of view would be that he needs to find the image again to initialize a "new" tracking experience, possibly at a different place.


Anyway, the workaround we ended up with is to first switch briefly to InstantTracking mode, wait one frame and then disable the InstantTracker, which doesn't cause any frame drop :

imageTracker.gameObject.SetActive(false);
instantTracker.gameObject.SetActive(true);

yield return null;
            
instantTracker.gameObject.SetActive(false);

This seems to be working fine.

Obviously we will be happy to remove this workaround once the bug is fixed in a future version.


Thank you again for your help throughout this ticket.


Regards,

Thales team

Hi,


these are, in fact, two different cases we are talking about. Yes, just disabling an active tracker causes the frame rate to drop (which I could reproduce). This is because no active tracker is present in the scene.

However, disabling one tracker and enabling an other one doesn't cause and frame drops since there is still one active tracker present in the scene (I just tested an verified this).


Here's a way to quickly test this:

  • Create a scene with two different trackers "Tracker01" and "Tracker02" (Image-, Object- or InstantTrackers - doesn't matter which)
  • Disable "Tracker02"
  • Create two UI buttons "Button01" and "Button02"
  • Disable "Button01"
  • When pressing "Button01"
    • Disable gameObject "Button01"
    • Enable gameObject "Button02"
    • Disable gameObject "Tracker02"
    • Enable gameObject "Tracker01" (it's important to first disable the active tracker and THEN enable the new one)
  • When pressing "Button02"
    • Disable gameObject "Button02"
    • Enable gameObject "Button01"
    • Disable gameObject "Tracker01"
    • Enable gameObject "Tracker02"


I hope that this is a more satisfying solution for you. Let me know if this is working for you.


With best regards,

Peter

 Hello,


"When you want to switch to instant tracking, simply disable the ImageTracker Gameobject and enable the InstantTracker object again."

This is the whole point of this ticket : this is not possible if the ImageTracking is currently tracking an image since it will cause huge frame drops...


What you previously suggested : "The quickest and easiest way to "disable" the tracking would be to disable the Camera attached to the WikitudeCamera object. This won't actually disable the tracking but doesn't display it any more".
We can disable the Camera to "hide" the ImageTracking but we have to activate it again to show the InstantTracking so this is pointless.


Regards

Hello TeamThales,


if you'd like to use two different tracking modes within one scene, that's not a problem. Just add the two trackers to you scene, set them up accordingly and disable the one you don't want to use.

For instance If you'd like to start with the image tracking, enable the ImageTracker at the start of the scene and disable the InstantTracker. When you want to switch to instant tracking, simply disable the ImageTracker Gameobject and enable the InstantTracker object again.


With best regards,


Peter

Hello,


Thank you for your quick follow-up, I just tested it.


Unfortunately, I'm afraid we cannot use this work-around, since we might want to switch from ImageTracking mode to InstantTacking mode, so the Camera attached to the WikitudeCamera object must be enabled for InstantTracking to work.


If there is no way to prevent the issue, we will wait for the bug to be solved by your team.


Regards

Hi TeamThales,


you did everything right, I just gave you a bad advice. Sorry for that!

Once the Trackable is loaded it doesn't matter if you disable it or not, unfortunately.

The quickest and easiest way to "disable" the tracking would be to disable the Camera attached to the WikitudeCamera object. This won't actually disable the tracking but doesn't display it any more:


    public Camera camera;
    
    public void PauseTracking() {
        camera.enabled = false;
    }

    public void ResumeTracking() {
        camera.enabled = true;
    }


Again, I'm really sorry for giving the wrong advice. I hope this solution works for you.


With best regards,


Peter

Hello,


Thank you for your answer.


We tried to disable the ImageTracker's Trackable child as you said but it seems that nothing changed. Moreover, disabling the Trackable child didn't prevent the tracking of the image.


We tried it on Wikitude Unity Pro SDK 9.6 and 9.12.


By "disabling the ImageTracker's Trackable child", did you meant the gameObject or only the script ?


Best regards.

Hello TeamThales,


I could reproduce your issue and am sorry that this error persists for over two years now. I've forwarded it to my team. In the meantime I have a workaround for you:

If you disable the ImageTracker's Trackable child instead of the ImageTracker itself the tracking stops but the frame rate doesn't change. By enabling the Trackable child again the tracking continues to work.


Please let me know if this work around works for you.


With best regards,

Peter

Hello,


I contacted Gökhan who was looking into this issue back then in order to get some updates and/or better insigt into the described error. Unfortunately due to Christmas holidays and vacations the support team will be out of office for a couple of days. We will be back in January. Sorry for the inconvenience.


With best regards,

Peter

Login or Signup to post a comment