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.

Image Targets

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 is 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.

Object Targets

A single device database can contain up to 20 Object Targets. Mixed device databases can contain 20 Object Targets and up to 80 other targets A maximum of 2 Object Targets can be tracked simultaneously.

VuMarks

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

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.

For Object Targets, edit the Max Simultaneous Tracked Objects field just below the other field in the VuforiaConfiguration 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:

Image Targets

VuforiaConfiguration.Instance.Vuforia.MaxSimultaneousImageTargets = 4;

Object Targets

VuforiaConfiguration.Instance.Vuforia.MaxSimultaneousObjectTargets = 2;

Native

Set the hint to define a maximum for your app exposed in a native application.

Image Targets

vuEngineSetMaximumSimultaneousTrackedImages(VuEngine* engine, int32_t maxNumberOfTargets);

Object Targets

vuEngineSetMaximumSimultaneousObjectTargets(VuEngine* engine, int32_t maxNumberOfTargets);