Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question AR Image Tracker can't distinguish different QR codes on phone

Discussion in 'AR' started by fred_1313, May 15, 2024.

  1. fred_1313

    fred_1313

    Joined:
    May 7, 2024
    Posts:
    1
    Hi everyone,

    I was trying to write a simple AR app that detects a QR code and places the default sphere on it. To test it, I created a virtual XR environment and placed different QR codes in it. This example works as expected. The sphere is placed on the correct QR code and not on the others.

    However, when I build an Android app and run it on my phone, it performs very poorly. The QR code (which I even printed out) is only sometimes detected and the app can't distinguish between the QR codes because the sphere is placed on each one depending on the camera's focus.

    Does anyone have any idea why the app is performing so poorly? Or any tips on how to improve performance?

    Thanks in advance!
     
  2. AliceMUnity

    AliceMUnity

    Unity Technologies

    Joined:
    Feb 28, 2024
    Posts:
    11
    The ARCore and ARKit models behind image tracking are designed for differentiating between a broad set of images users might encounter, and aren't really trained to differentiate between QR codes. You mention you're working with Android, so see google's recommendations here for the types of images that can be effectively tracked. From the linked page:
    If you'd like to distinguish between QR codes you'll need to add a QR scanner to your project. An approach more likely to be successful is to use a set of visually distinct images that follow google's image tracking guidelines.
     
    andyb-unity and newguy123 like this.