Skip to main content

Command Palette

Search for a command to run...

Building Image Tracking Augmented Reality with Vuforia

Published
β€’5 min read
Building Image Tracking Augmented Reality with Vuforia

Augmented Reality (AR) has transformed how we interact with digital content by blending it seamlessly with the real world. One of the most practical AR techniques is image tracking, where virtual objects appear when a specific image is detected.

In this blog, I’ll walk through how to build an Image Tracking AR application using Vuforia and Unity, covering the core concepts, setup process, and key learnings from my implementation.

What is Image Tracking in AR?

Image tracking in AR allows an application to recognize and track predefined images from the real world and overlay digital content on top of them.

Unlike marker less AR, image tracking relies on feature points (edges, textures, contrast) present in an image to identify and track it accurately in real time.

Common use cases:

  • Interactive posters and brochures

  • Educational flashcards or your own portfolio

  • Product visualization

  • Museum and exhibition guides

Why Use Vuforia?

Vuforia is one of the most popular AR SDKs for building image-based AR experiences. It integrates smoothly with Unity and offers robust image recognition and tracking capabilities.

Key advantages of Vuforia:

  • High-quality image recognition

  • Easy Unity integration

  • Cloud & local image databases

  • Cross-platform support (Android, iOS)

Tools & Technologies Used

  • Unity (Game Engine)

  • Vuforia Engine SDK

  • Android Studio (for Android build)

  • A smartphone camera

  • Vuforia Target Manager

Implementation

1) We will set up our Vuforia account first. Register with your personal email.

  • Then head to Plan and Licenses to make your license for your AR.

  • After this you can click on confirm and create your license.

  • Make sure to save this license key somewhere in your clipboard. As, we would need this to put in our unity engine.

2) Target Manager

Now the favourite task first, setup your target manager (aka the image that needs to be tracked).

  • After you click generate, then after that make sure you already have a high-resolution image saved with you (in jpg/png format). Then click on add target to add your target image.

  • For width: it will be 10. Add your target and then wait for some time you get a star rating for your image. Make sure it is a 4 or 5 so that the image is tracked well. A rating 3 or below, then change your image please.

  • Mine is a 5. (perfect catch then)

  • Then click on download database, and let the database get downloaded.

3) Unity

  • Download the Unity Hub first.

  • Then install Unity 2022.3.56f1 (LTS) with Android build support ticked during installation.

  • Then go to +new project to create a new project from scratch. Then pick 3d core for this.

  • Click on create project and then you can see the unity interface.

  • Let’s goo your first unity project is done.

4) Unity setup (aka a few things you need to do even if its boring!)

Even though this part may feel a bit tedious, it’s essential for AR to work correctly.

  • Download Vuforia Engine (Official)

    1. Go to developer.vuforia.com

    2. Log in

    3. Go to Downloads

    4. Download Vuforia Engine for Unity

πŸ“¦ You’ll get a .unitypackage file.

  • Import into Unity

    1. Open your Unity project

    2. Go to Assets β†’ Import Package β†’ Custom Package

    3. Select the downloaded VuforiaEngine.unitypackage

    4. Click Import All

⏳ Wait for it to finish importing.

  • Enable Vuforia in XR Settings

    Now do this:

    • Edit β†’ Project Settings

    • XR Plug-in Management

      • If not installed β†’ click Install XR Plug-in Management
    • Select Android

    • βœ”οΈ Check Vuforia Engine

Then also configure the rest settings in unity.

  • File β†’ Build Settings

    • Switch platform to Android
  • Player Settings β†’ Other Settings

    • Color Space β†’ Gamma

    • Auto Graphics API β†’ ❌ Uncheck

    • Remove Vulkan

    • Multithreaded Rendering β†’ ❌ Uncheck

    • Minimum API Level β†’ 25

    • Active Input Handling β†’ New Input System

5) Making your first AR tracker

  • Firstly, you need to import your the database you downloaded back then from Vuforia to the unity scene. To do this right click β†’ then import package β†’ custom package β†’ unity package file

  • Also add the license key, yes the one from Vuforia that you saved. (Window β†’ Vuforia Configuration β†’ Add license).

    ⚠️ This step is critical without it, image tracking will not work.

  • In hierarchy, there you will see camera and directional light.

    • Remove the camera.

    • Add AR Camera

      • right click in hierarchy

        • hover over Vuforia engine

        • then click AR camera, and it gets added to the hierarchy

  • Add your image target to the scene. In the inspector panel, choose the database name.

  • In the small box you can see your target image that you you initially put in Vuforia.

  • Now inside image target you can models to the image target just by dragging and dropping the models to the hierarchy. Make sure the models are child objects of Image Target.

    6) Importing 3D Models to Unity

    Sketchfab is a cool site where you can almost find all models to put in your unity scene or use for your project.

    • Download models in .glb or .gltf format

    • Install the package:
      com.unity.cloud.gltfast

    • Import the model and attach it to the Image Target

Here is a reference Youtube video. If you want to follow some tutorial around this.

Final Result πŸŽ‰

Click Play, point your phone camera at the target image, and watch your 3D model appear and track the image in real time. Make sure the image on the phone is the same as the one you uploaded in Vuforia.

Congratulations! 🎊
You’ve successfully built your first Image Tracking AR application using Vuforia and Unity.