KudanAR - Android  1.6.0
ARImageTrackable Class Reference

Public Member Functions

 ARImageTrackable ()
 
 ARImageTrackable (long nativeMem)
 
 ARImageTrackable (String name)
 
void loadFromPath (String path)
 
void loadFromPath (String path, boolean autoCrop)
 
void loadFromAsset (String asset)
 
void loadFromAsset (String asset, boolean autoCrop)
 
void finalize ()
 
ARWorld getWorld ()
 
void setName (String name)
 
String getName ()
 
boolean getDetected ()
 
void trackerStartFrame ()
 
float getWidth ()
 
float getHeight ()
 
void trackerEndFrame ()
 
void trackerSetDetected (boolean detected)
 
List< ARImageTrackableListenergetListeners ()
 
void addListener (ARImageTrackableListener listener)
 
boolean isFlowRecoverable (boolean globalSetting)
 
void setExtensible (boolean extensible)
 
boolean isExtensible ()
 
boolean isExtended ()
 
void clearExtensions ()
 

Detailed Description

The ARImageTrackable class represents an image that can be tracked. The ARImageTrackerManager will automatically update properties. Attach content to the world property to have it rendered on the trackable. An ARImageTrackable needs to be added to the ARImageTracker to be detected.

Constructor & Destructor Documentation

◆ ARImageTrackable() [1/3]

ARImageTrackable.ARImageTrackable ( )

Initialise an empty ARImageTrackable with values to be set later.

◆ ARImageTrackable() [2/3]

ARImageTrackable.ARImageTrackable ( long  nativeMem)

Initialise an ARImageTrackable with a pointer to its native object.

Parameters
nativeMem

◆ ARImageTrackable() [3/3]

ARImageTrackable.ARImageTrackable ( String  name)

Initialises an ARImageTrackable and assigns it the given name. Trackable names should be unique.

Parameters
nameThe name to give this trackable.

Member Function Documentation

◆ addListener()

void ARImageTrackable.addListener ( ARImageTrackableListener  listener)

Adds ARTrackableListener to ARImageTrackable

Parameters
listener

◆ clearExtensions()

void ARImageTrackable.clearExtensions ( )

For extended markers: clear all current extensions (they can be re-created after this, if extended tracking has not been disabled).

◆ finalize()

void ARImageTrackable.finalize ( )

Clears native memory pointer.

◆ getDetected()

boolean ARImageTrackable.getDetected ( )

Gets whether or not this trackable is currently being detected by the Image Tracker. This value is automatically set by the tracker.

Returns
True if this trackable is currently being detected, false if not.

◆ getHeight()

float ARImageTrackable.getHeight ( )

Gets the height of the trackable. This can be arbitrary but is used to determine the scale of the coordinate system that is attached to this node.

Returns
The scene height of this trackable.

◆ getListeners()

List<ARImageTrackableListener> ARImageTrackable.getListeners ( )

Gets a list of trackable listeners on the ARImageTrackable.

Example of use:

List<ARImageTrackableListener> trackableListeners = imageTrackable.getListeners();
Returns
The list of trackable listeners.

◆ getName()

String ARImageTrackable.getName ( )

Gets the name of the trackable.

Returns
The name of this trackable.

◆ getWidth()

float ARImageTrackable.getWidth ( )

Gets the width of the trackable. This can be arbitrary but is used to determine the scale of the coordinate system that is attached to this node.

Returns
The scene width of this trackable.

◆ getWorld()

ARWorld ARImageTrackable.getWorld ( )

Gets the image trackable's world node, the transformation of which is automatically updated by the tracker to represent the trackable's pose in the camera image. Content attached here will be rendered whilst the trackable is being detected.

Returns
The image trackable's world.

◆ isExtended()

boolean ARImageTrackable.isExtended ( )

Get whether any extensions have been made of this trackable, or if this trackable is itself an extension.

Returns
Whether this one trackable has extensions (true) or not (false).

◆ isExtensible()

boolean ARImageTrackable.isExtensible ( )

Get whether this trackable uses Extended Tracking and Detection.

Returns
Whether extensibility is enabled (true) or not (false) on this trackable.

◆ isFlowRecoverable()

boolean ARImageTrackable.isFlowRecoverable ( boolean  globalSetting)

For an individual trackable, query whether it is able to use recovery mode (needs to know the global setting). This function should not be called: use queryRecoveryMode(trackable) on ARImageTracker.

Parameters
globalSettingWhether recovery mode is on or not in general.
Returns
Whether recovery mode is used (true) or not (false) for this one trackable.

◆ loadFromAsset() [1/2]

void ARImageTrackable.loadFromAsset ( String  asset)

Load an image file into the ARImageTrackable from a packaged image file.

Example of use:

imageTrackable.loadFromAsset("example.jpg");
Parameters
assetThe path to the bundled image file relative to the app package, including file extension.

◆ loadFromAsset() [2/2]

void ARImageTrackable.loadFromAsset ( String  asset,
boolean  autoCrop 
)

Load an image file into the ARImageTrackable from a packaged image file and set whether or not Automatic Cropping should be used.

Example of use:

imageTrackable.loadFromAsset("example.jpg", true);
Parameters
assetThe path to the bundled image file relative to the app package, including file extension.
autoCropWhether to use the Automatic Cropping feature. True if yes, false if no.

◆ loadFromPath() [1/2]

void ARImageTrackable.loadFromPath ( String  path)

Load an image file into the ARImageTrackable from a full file path. Images loaded with this method will not use the Automatic Cropping feature.

Example of use:

imageTrackable.loadFromPath("/mnt/sdcard/images/example.jpg");
Parameters
pathThe full path to the file, including all folders and file extension.

◆ loadFromPath() [2/2]

void ARImageTrackable.loadFromPath ( String  path,
boolean  autoCrop 
)

Load an image file into the ARImageTrackable from a full file path and set whether or not Automatic Cropping should be used. Autocropping is a feature that automatically finds the most useful sub-region of a trackable image, and uses that for tracking and detection. This allows images containing large borders to be used without sacrificing tracking resolution. Cropping is automatic and makes no difference to how the trackable objects are used the tracked region will never look cropped. This must be enabled for individual markers when they are created from images.

Example of use:

imageTrackable.loadFromPath("/mnt/sdcard/images/example.jpg", true);
Parameters
pathThe full path to the file, including all folders and file extension.
autoCropWhether to use the Automatic Cropping feature. True if yes, false if no.

◆ setExtensible()

void ARImageTrackable.setExtensible ( boolean  extensible)

Set whether or not this trackable uses Extended Tracking and Detection. Extended Tracking and Detection is a feature where trackables can be extended by automatically creating new markers from the surrounding scene. This means that after being expanded, trackables can be detected and tracked from much further away. This can be activated on a per-trackable basis and should ideally only be used for stationary markers, such as posters. Extended Tracking is good for tracking small objects at large distances when moving away from the marker. Extended Tracking is not designed for use with markers that are not stationary. Enabling this feature will require slightly more memory space.

Example of use:

imageTrackable.setExtensible(true);
Parameters
extensibleWhether or not this marker should use Extended Tracking and Detection. Setting this to false will prevent any more extensions being made (but not clear existing ones).

◆ setName()

void ARImageTrackable.setName ( String  name)

Sets the name of the trackable. This needs to be unique, otherwise the tracker will not be able to find it. If initialised from a trackable image file then this is read in automatically.

Example of use:

imageTrackable.setName("example");
Parameters
nameThe name to assign to this trackable.

◆ trackerEndFrame()

void ARImageTrackable.trackerEndFrame ( )

Updates trackable listeners with trackable event information.

◆ trackerSetDetected()

void ARImageTrackable.trackerSetDetected ( boolean  detected)

Sets trackable state.

Parameters
detectedWhether the trackable has been detected.

◆ trackerStartFrame()

void ARImageTrackable.trackerStartFrame ( )

Sets detection state to be detected.


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