VuMark API Overview¶
The VuMark API is exposed in the native Vuforia Engine C API.
A VuMark target is a template for a defined set of instances that each has a unique ID.
With VuMarks, you can encode different data for every instances while maintaining a consistent visual image or logo. Create a VuMark Template following the VuMark Design Guide and use the Vuforia Target Manager to generate and download a VuMark database.
Create a VuMark Observer¶
The VuMark Observer is the template from which VuMark instances are recognized. The VuMark Template is loaded from a generated VuMark database. Instances can be of id type: byte, string, or numeric.
The above code snippet creates a VuMark Observer loaded from the VuMark database. The databasePath
and templateName
must match the content of the database. When the Vumark Observer is created, it is activated by default.
Configuring and creating an Observer with non-default additional optional arguments should be done while other Observers from the same database is deactivated to avoid performance constraints.
Observations¶
The VuMark Observer produces Observations that are collected in the State. Get the State from the Engine and parse them to the ObservationTargetInfo. See the Observer and Observations article for more information on target and status info.
Creation of Observation list
Then, parse the observation list to get info on the target(s).
Destroy Observer and Observation¶
Stop and destroy objects and processes after usage to free up memory.
For Image Targets, you call the following to destroy the Image Target Observation and the Image Target Observer:
Destroy ObservationList
Destroy the Obsever
Accessing VuMark specific Observation Information¶
A VuMark's Template Info contains the VuMark's unique Id that is persistent across all its VuMark instances. Also, the template user data is retrieved from the VuMark Template Observation.
VuMark Observation Instance Info¶
In addition to the template info, the instance specific information can be queried from the VuMark Observation as well. Every instance carries a unique id that can be identified with calling dataType
and retrieved with below call.
VuMark Configuration¶
In this section, we present additional common configuration options for VuMark Observers.
Size¶
Get the size (height and length) of a VuMark template in meters.
Scale¶
Re-scale the VuMark template with a scale factor retrieved from the GetTemplateSize(). All detected instances will inherit the scale changes.
UserData¶
Get the user data for the VuMark template from the Observer's database.
Background Image¶
For VuMarks in particular, you can decide whether to also use the background image to track with. This is for example useful if the logo contains a lot of features and details or if it contains very few features. See VuMark Design Guide for more detail on background images. Use the get/set to switch it on or off.
Bounding Box¶
Use this function to get an axis-aligned bounding box of a VuMark Template from its respective Observer, and relative to its frame of reference.