VuMark API Overview

In addition to the Scripting API in Unity, the VuMark API is exposed in C++. The VuMark target is part of the ObjectTracker class. There is also a VuMarkTemplate class which itself is a target and acts as the template for run-time VuMarkTarget instances.


The VuMarkTemplate is the target that is loaded from the dataset and acts as the parent of all of the specific instances of VuMarkTargets, where a VuMarkTarget is defined by its InstanceIdD.

The template contains both the origin of the VuMark, as well as potentially the user data packaged in the dataset.

/// Get the Type for class 'VuMarkTemplate'.
static Type getClassType();

/// Get the user data for this template from the underlying dataset.
virtual const char* getVuMarkUserData() const = 0;


A VuMarkTarget is created when a new instance of a VuMark is detected. Each result refers back to its VuMarkTarget and the VuMarkTarget refers back to the VuMarkTemplate in the dataset. The VuMarkTarget is where the InstanceID can be retrieved as well as the generated image of the VuMark including its printed code. A VuMarkTarget must be used in combination with a VuMarkTemplate with a specific instanceID.

NOTE: Some ObjectTarget functionality, such as setting the target size, or enabling or disabling extended tracking, cannot be applied to a VuMarkTarget instance. Instead, you need to make the required changes on the associated VuMarkTemplate instance.

/// Get the VuMarkTemplate that this instance was instantiated from.
virtual const VuMarkTemplate& getTemplate() const = 0;

/// Get the instance ID of this particular VuMark.
virtual const InstanceId& getInstanceId() const = 0;

/// Get a generated version of the VuMark.
virtual const Image& getInstanceImage() const = 0;


The VuMarkTargetResult encapsulates a particular detected/tracked VuMark. VuMarks include a ResultID for the VuMarkTargetResult, which stays consistent for a particular tracked result until tracking is lost.

The use case is that if you have two instances being tracked that have the exact same InstanceID, for example; playing an animation on each one of them asynchronously. Since the order of results in the Vuforia State are not guaranteed to stay the same across frames, we need to provide a ResultID so that the animations don’t pop back and forth between the two identical instances. 

virtual int getId() const = 0;


The InstanceID is retrieved from the VuMarkTarget and provides methods for querying the ID that was read from the VuMark. An InstanceID can be either a byte buffer, an ASCII string, or a number. The unique ID is assigned when the VuMark is first detected and is consistent as long as the VuMark remains visible. Use the instanceID to distinguish between VuMarkTargetResults appearing in the same camera frame.

virtual const InstanceId& getInstanceId( ) const

Using VuMarks in Native Code

Querying VuMark Target Results

The state of each TrackableResult can be queried from the State object to access its pose, determine its type, and obtain a reference to its associated Trackable instance.

The VuMarkTargetResult will enable you to retrieve the VuMark‘s Template, Instance ID and Instance Image.

const Vuforia::State state = Vuforia::TrackerManager::getInstance().getStateUpdater().updateState();

const auto& trackableResultList = mVuforiaState.getTrackableResults();
for (const auto* result : trackableResultList)
        // Get the trackable
        const Vuforia::Trackable &trackable = result->getTrackable();
        const char* trackableName = trackable.getName();
        if (result->isOfType(Vuforia::VuMarkTargetResult::getClassType()))
            const Vuforia::VuMarkTargetResult* vmResult = (const Vuforia::VuMarkTargetResult*)result;
            const Vuforia::VuMarkTarget &vmTarget = vmResult->getTrackable();
            const Vuforia::VuMarkTemplate& vmTemplate = vmTarget.getTemplate();
            const Vuforia::InstanceId & vmId = vmTarget.getInstanceId();
            const Vuforia::Image & vmImage = vmTarget.getInstanceImage();