Search code examples
androidunity-game-enginevuforia

Vuforia + QR code scanner + Image targets


Is it possible to scan QR code, get info from it and show 3D model on qr code frame?

I made project where some qr code can be loaded as image tracker, but how show 3D model using info from ANY qr code (programmatically) ?

    void qrCodeResult(String qrCodeText) {
       if (qrCodeText.equals("HULK")) {
          showHulk3DModel();// this model should be bind to the qr code frame
    }
}

Solution

  • Vuforia, or any similar SDKs, require a database with the images, so you cannot really use it to track just any QR code. So you cannot really do what you want with such SDKs.

    The main options I see are:

    1. If possible product-wise, attach the QR code to an image that Vuforia can track. This way you will be able to track it, and get information about the location in order to place your 3D model. There is one major complexity here - in order to read the QR code, you will have to use some QR library, such as xzing, and on each frame to take the image from Vuforia (they have API for that) and pass it to the QR library in order to try and read it.

    2. The harder option - use some image processing library, such as OpenCV, to identify and track the QR code. For identifying the QR code and reading it you can find quite a few code samples on the web.