KudanAR - Android
ARImageTracker Class Reference

Public Member Functions

 ARImageTracker ()
 
ARNode getBaseNode ()
 
void initialise ()
 
void deinitialise ()
 
void addTrackable (ARImageTrackable trackable)
 
List< ARImageTrackablegetTrackables ()
 
int getNumberOfDetectedTrackables ()
 
List< ARImageTrackablegetDetectedTrackables ()
 
void addTrackableSet (ARTrackableSet set)
 
void setMaximumSimultaneousTracking (int maxToTrack)
 
void start ()
 
void stop ()
 
ARImageTrackable findTrackable (String trackableName)
 
void setRecoveryMode (boolean doRecovery)
 
boolean queryRecoveryMode ()
 
void prohibitRecoveryMode ()
 
boolean queryRecoveryMode (ARImageTrackable trackable)
 
void toggleParallelDetection (boolean isParallel)
 
boolean isDetectorParallel ()
 

Static Public Member Functions

static ARImageTracker getInstance ()
 

Detailed Description

Manager singleton for the image tracker. The image tracker is capable of detecting pre-registered 2D images within the camera stream.

Constructor & Destructor Documentation

ARImageTracker ( )
inline

Initialises ARImageTracker and assigns a new empty base node.

Member Function Documentation

void addTrackable ( ARImageTrackable  trackable)
inline

Add a trackable to the image tracker so that it may be detected. The trackable's name must be unique compared to the currently added trackables.

Parameters
trackableThe trackable to add.
Returns
YES if the marker was successfully created and added to the tracker, NO otherwise.
void addTrackableSet ( ARTrackableSet  set)
inline

Add a set of trackables to the image tracker so they may be detected.

Parameters
setThe set of trackables to add. This must be in the .KARMarker format.
void deinitialise ( )
inline

Deinitialise the ARImageTracker. This method should only be called once during cleanup, ideally when the AR View Controller is being dismissed. When the ARImageTracker is denitialised, it performs the following:

  • The native ImageTracker interface is deinitialised and destroyed.
  • The list of trackables is emptied.
  • The base node is reset with a new ARNode.
ARImageTrackable findTrackable ( String  trackableName)
inline

Find a trackable registered with the tracker by its name.

Example of use:

ARImageTrackable trackable = ARImageTracker.getInstance().findTrackable("example");
Parameters
trackableNameThe name of the trackable to find.
Returns
The matching trackable, or nil if not found.
ARNode getBaseNode ( )
inline

Returns the node that is the parent of all trackable worlds. It can be used to toggle visibility of all markers.

Returns
The Image Tracker's base node.
List<ARImageTrackable> getDetectedTrackables ( )
inline

Gets the list of detected ARImageTrackable objects from the last process frame.

Returns
The list of detected ARImageTrackable objects from the last processed frame.
static ARImageTracker getInstance ( )
inlinestatic

Returns the ARImageTracker singleton. The first time this is called, a new ARImageTracker singleton is initialised if it has not been already.

Returns
The ARImageTracker singleton
int getNumberOfDetectedTrackables ( )
inline

Returns the number of trackables detected in the last process frames.

Returns
The number of trackables detected in the last processed frame.
List<ARImageTrackable> getTrackables ( )
inline

Returns the list of all registered trackables. The order of the list will be the order they were added in, with the most recently added trackable being the last element.

Returns
The list of registered trackables.
void initialise ( )
inline

Initialise the ARImageTracker. This method should only be called once during setup. When the ARImageTracker is initialised, it performs the following:

  • The native Image Tracker object is initialised.
  • An empty list of image trackables is created.
boolean isDetectorParallel ( )
inline

Query whether marker detection is parallelised (for simultaneous detection of multiple trackables) or not.

Returns
Boolean indicating whether detection can run in parallel or not.
void prohibitRecoveryMode ( )
inline

Prohibit recovery mode for all trackables (ignoring the global setting).

boolean queryRecoveryMode ( )
inline

Query whether recovery mode is on, for all trackables in general. This could be overridden for individual trackables.

Returns
Whether recovery mode is used (true) or not (false).
boolean queryRecoveryMode ( ARImageTrackable  trackable)
inline

For an individual trackable, query whether it is able to use recovery mode (depends on the global setting and the trackable's own setting).

Parameters
trackableThe trackable for which recovery mode is being queried.
Returns
Whether recovery mode is used (true) or not (false) for this one trackable.
void setMaximumSimultaneousTracking ( int  maxToTrack)
inline

Set the maximum number of trackables which can be tracked at the same time. The detector will not run if the maximum number are already tracked. This does not affect the number of trackables which can be loaded at the same time. Set to a value of 0 for an unlimited number of concurrent tracked markers. This is the default value.

Parameters
maxToTrackThe maximum number of trackables which can be simultaneously tracked
void setRecoveryMode ( boolean  doRecovery)
inline

Set whether recovery mode is enabled, for all trackables. This can be overridden on a per-trackable basis by using the force- and prohibit- functions of KudanImageTrackable.

Parameters
doRecoveryWhether recovery mode is used (true) or not (false).
void start ( )
inline

Start the Image Tracker. Tracking works best in well lit conditions.

void stop ( )
inline

Stop the Image Tracker. Any visible objects on-screen will stop rendering at this time.

void toggleParallelDetection ( boolean  isParallel)
inline

Set whether marker detection is parallelised (for simultaneous detection of multiple trackables) or not. The number of threads is not controllable but set automatically for the device.

Parameters
isParallelSet whether detection can run in parallel (true) or not (false).

The documentation for this class was generated from the following file: