C++ Java Unity
Java Reference
ObjectTracker Class Reference

Detailed Description

A type of Tracker that tracks objects in the real world.

An ObjectTracker tracks all target types that inherit from ObjectTarget (for a full list, refer to the inheritance tree diagram for ObjectTarget).

The data for these Trackable instances is stored in DataSet instances, which are owned and managed by the ObjectTracker.

The ObjectTracker class provides methods for creating, activating and deactivating DataSets.

Note: Calls to activateDataSet() and deactivateDataSet() should be avoided while the ObjectTracker is actively processing a frame, as such calls will block until the ObjectTracker has finished.

If you do need to call these methods during execution, the suggested way of doing so is via the UpdateCallback mechanism, as the callback is done at a point where the ObjectTracker is guaranteed to be idle. Alternatively, the ObjectTracker can be explicitly stopped and then restarted. However this is a very expensive operation.

Inheritance diagram for ObjectTracker:
Tracker

Public Member Functions

boolean equals (Object obj)
 
DataSet createDataSet ()
 Create an empty DataSet. More...
 
boolean destroyDataSet (DataSet dataset)
 Destroy the given DataSet and release allocated resources. More...
 
boolean activateDataSet (DataSet dataset)
 Activate the given DataSet. More...
 
boolean deactivateDataSet (DataSet dataset)
 Deactivate the given DataSet. More...
 
DataSet getActiveDataSet (int idx)
 Get a specific active DataSet. More...
 
int getActiveDataSetCount ()
 Get the number of currently active DataSets. More...
 
DataSetList getActiveDataSets ()
 Provides access to the list of currently active active datasets. More...
 
ImageTargetBuilder getImageTargetBuilder ()
 Get the ImageTargetBuilder for the current scene. More...
 
TargetFinder getTargetFinder ()
 Get the TargetFinder for the current scene. More...
 
- Public Member Functions inherited from Tracker
boolean equals (Object obj)
 
Type getType ()
 Get the Type of this instance (may be a subclass of Tracker). More...
 
boolean isOfType (Type type)
 Get whether this Tracker instance's type equals or has been derived from the given type. More...
 
boolean start ()
 Start the Tracker. More...
 
void stop ()
 Stop the Tracker. More...
 

Static Public Member Functions

static Type getClassType ()
 Returns the Type for class 'ObjectTracker'. More...
 
- Static Public Member Functions inherited from Tracker
static Type getClassType ()
 Get the Type for class 'Tracker'. More...
 

Member Function Documentation

boolean equals ( Object  obj)
static Type getClassType ( )
static

Returns the Type for class 'ObjectTracker'.

DataSet createDataSet ( )

Create an empty DataSet.

Returns
the new instance on success, NULL otherwise.

Use destroyDataSet() to destroy a DataSet that is no longer needed.

boolean destroyDataSet ( DataSet  dataset)

Destroy the given DataSet and release allocated resources.

Returns
true on success, or false if the DataSet is active.
boolean activateDataSet ( DataSet  dataset)

Activate the given DataSet.

Returns
true if the DataSet was successfully activated, otherwise false (check application log for failure details0.

Note: Activating a DataSet during live processing can be a blocking operation. To avoid this, call activateDataSet via the UpdateCallback mechanism (which guarantees that the ObjectTracker will be idle), or explicitly stop the ObjectTracker first, and then start it again when finished.

boolean deactivateDataSet ( DataSet  dataset)

Deactivate the given DataSet.

Returns
true if the DataSet was successfully deactivated, otherwise false (e.g. because the DataSet is not currently active) (check application log for failure details).

Note: Deactivating a DataSet during live processing can be a blocking operation. To avoid this, call deactivateDataSet via the UpdateCallback mechanism (which guarantees that the ObjectTracker will be idle), or explicitly stop the ObjectTracker first, and then start it again when finished.

DataSet getActiveDataSet ( int  idx)

Get a specific active DataSet.

(DEPRECATED)

Parameters
idxThe index of the active DataSet to get, in the range 0..getActiveDataSetCount()-1.
Returns
The active DataSet with the given index, or NULL if the index is out of range.
Deprecated:
This API has been deprecated. It will be removed in an upcoming Vuforia release. Use the getActiveDataSets() API instead.
int getActiveDataSetCount ( )

Get the number of currently active DataSets.

(DEPRECATED)

Deprecated:
This API has been deprecated. It will be removed in an upcoming Vuforia release. Use the getActiveDataSets() API instead.
DataSetList getActiveDataSets ( )

Provides access to the list of currently active active datasets.

ImageTargetBuilder getImageTargetBuilder ( )

Get the ImageTargetBuilder for the current scene.

Returns
The ImageTargetBuilder that should be used if you want to generate ImageTargets at runtime from the camera input.
TargetFinder getTargetFinder ( )

Get the TargetFinder for the current scene.

Returns
The TargetFinder that should be used if you want to retrieve targets via cloud-based recognition.