Image scanning in AR

Jalaj SinghalJalaj Singhal
3 min read

We'll look at another fascinating AR use case today: image scanning with Unity's Vuforia Engine. With the help of this project, we can create a digital 3D model or animation over a real-world image, such as a book cover, card, or poster.

  1. AR of this kind is utilized in:

  2. Interactive textbooks

  3. AR business cards

  4. Packaging for products

  5. Displays in museums


🛠️ Tools I Used

  • Unity 6

  • Vuforia Engine SDK

  • Vuforia Developer Account

  • AR Camera & Image Targets

  • 3D Models or Videos


🎯 What We’re Going to Build

We will develop an augmented reality application that overlays a 3D model on a real-world image (Image Target) after scanning it. The model will magically appear over the image once the camera has detected it!


How It Works

  1. Vuforia Engine handles image recognition.

  2. Unity renders the 3D content.

  3. Image Target acts as a marker that triggers the AR content.

  4. You point your phone’s camera at a printed image, and the digital content appears.


Step-by-Step Setup

  1. Unity Setup-

    1. Open Unity Hub and click "New Project"

    2. Choose 3D (URP or Built-in) – name your project something like ARImageScanner

    3. Go to File > Build Settings → switch to Android or iOS (depending on your target device)

    4. In the Player Settings, enable AR Support (under XR Settings)

    5. Go to Window > Package Manager → install Vuforia Engine package

  2. Vuforia

    1. Visit: https://developer.vuforia.com

    2. Click on Register / Sign In

    3. Once signed in, go to DevelopLicense Manager

    4. Click "Get Development Key"

    5. Enter a name for your project and accept the agreement

    6. Copy the generated License Key – you will need this inside Unity

  3. Vuforia Settings for image target

    1. Go to Target Manager on the Vuforia Developer Portal

    2. Click “Add Database” → Name it (e.g., “MyARImages”) → select Device Database

    3. Open the new database → click “Add Target”

    4. Choose Single Image

    5. Upload a clear, high-contrast image (e.g., a poster, book cover)

    6. Give it a name and enter the physical width in real-world units (e.g., 10 for 10cm)

    7. Once uploaded, click Download Database → choose Unity Editor format

    8. This will download a .unitypackage file that we will import into Unity

  4. Import vuforia

    1. Drag the .unitypackage you downloaded from Vuforia into your Unity project

    2. In the Hierarchy:

      • Delete the default Main Camera

      • Go to GameObject → Vuforia Engine → AR Camera

    3. Select AR Camera, go to its Inspector Panel

      • Under Vuforia Configuration, paste your License Key

      • This links your Unity project to Vuforia’s services

  5. Add and Configure the Image Target

    1. Go to GameObject → Vuforia Engine → Image Target

    2. Select the Image Target object in the Hierarchy

    3. In the Inspector, set the Database to the one you imported (e.g., "MyARImages")

    4. Set the Image Target Name to the one you uploaded earlier (this matches the image file)

    5. Set the Physical Width (e.g., 0.1 meters for 10 cm) to match real-world size

  6. Attach a 3D Model or Video to the Target

    1. Import any 3D model (e.g., .fbx file or prefab) into your Unity project

      • You can download models from Sketchfab, TurboSquid, or use Unity’s Asset Store
    2. Drag your model as a child object of the Image Target

    3. Position and scale it correctly so that it appears over the image when scanned


Challenges Faced

1. Image Quality

  • Low-resolution or reflective images won’t scan well.

  • Try to use high-contrast and unique images.

📱 2. Testing on Devices

  • The camera sometimes fails to focus, test on multiple phones and lighting conditions.

🔄 3. Orientation Issues

  • Make sure the 3D model is placed correctly relative to the image, or it will appear flipped or sideways.

0
Subscribe to my newsletter

Read articles from Jalaj Singhal directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Jalaj Singhal
Jalaj Singhal

👋 Greetings, Jalaj Singhal here! 🚀 I'm an enthusiastic blogger who enjoys delving into the world of technology and imparting my knowledge to the community. 📃 Having experience in HTML and CSS, I enjoy creating interesting and educational content that demystifies difficult ideas and gives readers the tools they need to advance their knowledge. 🌐 I try to contribute to the active tech community and encourage relevant discussions on Hash Node, where you can find my writings on the subject of web development. 💡 Together, let's connect and go out on this fascinating path of invention and learning!