Detect and Track Multiple Targets Simultaneously

Vuforia allows you to track multiple targets simultaneously. This enables interactions between targets as two or more targets are detected while in the same view.

As a developer, you will need to consider the maximum number of targets you wish to track simultaneously and how it will affect the user experience and the performance of the device. Each target that is active in the camera’s field of view (FoV) will increase the computational load on the device.

Additionally, consider the targets’ physical sizes and the maximum distances from which a set of targets should be detected and tracked together. The greater the number of targets, the farther the camera needs to be from them to capture them all in its FoV. See Working with the Camera for more information.

To take into account these factors (user experience and performance) it is best to set a maximum of targets that can be tracked simultaneously. By default, Vuforia Engine is set to track 1 target at a time.

Simultaneous Tracking

The number of targets tracked simultaneously in an application can be set with a parameter after initialization of the Engine or at runtime.

Image Targets, Multi Targets, and Cylinder Targets

Cylinder and Multi Targets are counted as single tracked targets even though they are made of a combination of several Image Targets. For example, a cube or cuboid Multi Target with six faces (6 Image Targets) is equivalent to six targets in a device database but will be tracked as a single target at runtime. For Cylinder Targets made from 2 to 3 images are also tracked as a single target.

There is no maximum for simultaneous tracked Image Targets, but we recommend not to set more than 5 due to performance limitations of the device. The maximum number of image-based targets in a device database is limited to 1.000. Use cases for more images should use Cloud Recognition.

VuMarks

VuMarks are detected and tracked similar to Image Targets. The recommendation for Image Targets also apply to tracking VuMark instances simultaneously.

Model Targets and Area Targets

Only one Model Target can be tracked at a time and only one Area Target can be tracked at a time. You can still have multiple of Model Targets and Area Targets active and ready to be detected.

You can track other targets alongside Model Targets and Area Targets simultaneously. For example, you can track both a Model Target, Area Target, and an Image Target at the same time. Just keep in mind the increased computational load for tracking targets simultaneously.

Barcode Scanner

The Barcode Scanner can detect and track multiple barcodes simultaneously. See Best Practices for Barcode Scanning and Barcodes in Unity to enable the simultaneous tracking.

Define the Maximum of Simultaneously Tracked Targets

Unity

You can specify the number using the Max Simultaneous Image Targets property in the Vuforia Configuration panel.

You can also specify this request programmatically at runtime using the following C# code. This needs to be set before Vuforia Engine is started in a scene, e.g. in an Awake method:

Unity

VuforiaConfiguration.Instance.Vuforia.MaxSimultaneousImageTargets = 4;

Native

vuEngineSetMaximumSimultaneousTrackedImages(VuEngine* engine, int32_t maxNumberOfTargets);

Can this page be better?
Share your feedback via our issue tracker