Search Unity

Bug Enabling AR Plane Manager breaks AR Tracked Image Manager

Discussion in 'AR' started by caleb8814, Jan 14, 2021.

  1. caleb8814

    caleb8814

    Joined:
    Feb 10, 2020
    Posts:
    5
    I have an Android app that uses the position of images to place objects in the world. After using an image to place one of the objects I enable the Plane Manager (planemanager.enabled = true) to correct the rotation of the object by using the rotations of the planes. After the rotation is applied I disable the Plane Manager (planemanager.enabled = false.)

    After I move onto the next portion and try to scan an image using the AR Tracked Image Manager, the manager won't pick up the image no matter how long I stand there and move the phone around. I've tried different test situations to make sure that it is the Plane Manager and that is the only addition to my code that breaks the Image Tracking. With everything else the same, except just never enabling the plane manager, the Image Tracking works perfectly.

    If it's of any help I have a customized debug message area where I print the count of images in ARTrackedImagesChangedEventArgs.updated. Before I enable the Plane Manager it shows a count of 2 (And I have scanned 2 images up to this point). But, after the Plane Manager is disabled and the Image Manager enabled it shows that there are 0 images in the count.

    I haven't found anything that says you can't use multiple managers in a single app, but realize that having multiple managers makes the app more complicated and difficult for the phone to run.

    I am using Unity 2020.1.10f1.

    Any help would be appreciated!
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,819
    Hey there @caleb8814, team were a bit confused by "After using an image to place one of the objects I enable the Plane Manager (planemanager.enabled = true) to correct the rotation of the object by using the rotations of the planes."

    Why do you believe this is necessary?
     
  3. caleb8814

    caleb8814

    Joined:
    Feb 10, 2020
    Posts:
    5
    Thanks for the reply!

    I believe this is necessary because sometimes the rotations given from the image are off. With the rotations from the planes, I can have the object rotated much more consistently to how it should be.

    If it helps to answer your question as to my reasoning, I don't use image tracking in the traditional sense of needing the object to be right on top of the image. Also, I can't have the image consistently in camera to track. The image is actually outside of the room where the experience is. Thus, the user "scans" the image and then moves inside the room where they can't see the image anymore. When they "scan" the image I collect the image's position and rotation and place the object like a meter and a half away with some adjusted rotations.
     
  4. Voronoi

    Voronoi

    Joined:
    Jul 2, 2012
    Posts:
    584
    I understand your goal, but to fix this problem I approached it more as a user experience/interface problem. When using image tracking, it's always a bit jittery which I assume is because the video is constantly being analyzed and compared to the reference image. Really distinct, unique reference images are less jittery.

    When using multiple reference images, that are somewhat similar, I definitely see more jumping around as I assume the recognition is getting confused and trying to decide which marker is being viewed. I can't just have my virtual object pop into the world on recognition, because it could be off by several degrees at any given time.

    What I did instead is show the user a plane on top of the image, so that they could see it jumping around and when it's off kilter. When they see that, they move their phone and eventually will see that it settles down and matches the marker. They then hit 'OK', and the 3D object pops into the world.

    Essentially, the 3D object that the AR Image Tracking creates is a plane 'placeholder' and not the actual /final 3D object I want to be instantiated.

    I think what you are doing sounds a bit complicated. If the image is not even in the same room, I think I'd try to just use the image as a trigger and try to get an idea of the phone's distance from the trigger. If the plane is just being used to recognize the floor, I would think that data might be available elsewhere, without the need for plane projection.
     
  5. caleb8814

    caleb8814

    Joined:
    Feb 10, 2020
    Posts:
    5
    Thank you for taking the time to reply!
    While you provide some great UX improvements to my design, at the moment I'm not worried about the objects being misaligned.
    What I'm trying to fix is that after using the Plane Manager I can't use the Tracked Image Manager. For some reason the Plane Manager breaks the Tracked Image Manager.
     
  6. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,819
    Connected with the team. The plane detection and image tracking features should be able to be used together. If, in your case, they aren't, we'll need you to file a bug report so that we might determine why that may be.
     
    AM-Dev likes this.
  7. caleb8814

    caleb8814

    Joined:
    Feb 10, 2020
    Posts:
    5
    Okay! I will file it and get a nice list of steps to reproduce.
    Thanks
     
  8. caleb8814

    caleb8814

    Joined:
    Feb 10, 2020
    Posts:
    5
    After testing on other phones it looks like the issue was only with the phone I was using, an LG Stylo 5. But, the error doesn't occur on the two Samsung devices that I tried.
     
    AM-Dev likes this.