Augmented Images developer guide for Unity

Learn how to use Augmented Images in your own apps.

Build and run the sample app

Create a new project in Unity based on the quickstart.

When building the app, make sure to include the augmented image scene located in Assets/GoogleARCore/Examples/AugmentedImage/Scenes/.

Make sure your device is connected to your machine and then click Build and Run. Unity builds your project into an Android APK, installs it on the device, and launches it.

As you move your device, the app automatically detects and tracks images from the set of reference images located in Assets/GoogleARCore/Examples/AugmentedImage/Images/.

Create database file

In Project window, select your desired set of reference images (PNG or JPG), then right-click and select Create > Google ARCore > AugmentedImageDatabase.

A new image database is created in the same folder as the reference images.

The Inspector window displays the images in the database and the image quality score. The system may struggle to detect images with quality scores below 75.

You can optionally specify a physical width (in meters) for each image. If you do so, ARCore can estimate the pose of the physical image at runtime as soon as ARCore detects the physical image, without requiring the user to move the device to view the physical image from different viewpoints.

Use the database file

  1. In the Project window, go to Assets/GoogleARCore/Examples/AugmentedImage/Configurations and open AugmentedImagesSessionConfig.

  2. In the Inspector, click the box next to Augmented Image Database and select the database file you created.

Get the AugmentedImage

See AugmentedImageExampleController.cs, located in Assets/GoogleARCore/Examples/AugmentedImage/Scripts, for an example on how to get the trackable:

Session.GetTrackables<AugmentedImage>(myList, TrackableQueryFilter.Updated);