Image Tracking

The Zappar Image Tracking Target lets you attach digital content to a physical image as it moves around in the camera view. It's great for putting 3D content onto posters, business cards, flyers, etc.

The Zappar package can detect and track content to a Target Image. Before developing an image tracked project in Unity you must first train an image into a Target Image (.zpt file).

Zappar Image Trainer

To train an image using the Zappar Image Trainer, follow the steps below:

  1. Open the Zappar Image Trainer window in from the Editor tab in the Zappar Menu entry.
  2. Add an image to the Source image path field.
  3. We recommend setting default parameters for the first use of the image trainer but please note that you will need to enable ZPT Overwrite explicitly if the file already exists in the StreamingAssets folder.
  4. You can also decide not to include an image preview with your .zpt file to minimize your build size.
  5. maxWidth and maxHeight refers to the training model parameters and won't resize your source or preview image. We recommend keeping it unchanged for optimum usage.
  6. Click Start.

Zappar Image Trainer

The resulting image will be automatically added to your StreamingAssets folder.

ZapWorks CLI

If you'd prefer, you can use the ZapWorks CLI tool to generate a target image easily via the following command:

zapworks train myImage.png

The ZapWorks CLI will generate a .zpt file (i.e. myImage.png.zpt) that should be placed in a folder named StreamingAssets in the root level of your project.

Please note that you will have to manually drag and drop the .zpt file into the StreamingAssets folder, as Unity will not recognize it as a file type that can be imported using "Import New Asset".

You will need to create a StreamingAssets folder inside the main Asset folder, if one doesn't already exist.

Image Tracking Target

  1. Add the Image Tracking Target into your Hierarchy.
  2. Select on the Zappar Image Tracking Target in the Hierarchy.
  3. Update the Target property to the recently trained Target Image (found in the StreamingAssets folder).
  4. Drag and drop digital content on top of the Zappar Image Tracking Target in the Hierarchy.

This content should become a child of the Image Tracking Target and appear tracked to it in the viewport.

On Seen and On Not Seen Events

The Zappar Image Tracking Target triggers events when the physical target image enters and exits the camera view (On Seen and On Not Seen, respectively). With these events, you can specify something to happen when either of these events is triggered. For example, showing and hiding content:

On Seen and On Not Seen Events

Please refer to the Advanced Usage article for further details.

zapcode branded_zapcode i