![]() |
KudanAR - iOS
1.6.0
|
#import <ARImageTrackerManager.h>
Inherits NSObject.
Instance Methods | |
(void) | - initialise |
(void) | - deinitialise |
(BOOL) | - addTrackable: |
(void) | - removeTrackable: |
(void) | - addTrackableSet: |
(ARImageTrackable *) | - findTrackableByName: |
(void) | - process:width:height:padding: |
(void) | - start |
(void) | - stop |
(void) | - setMaximumSimultaneousTracking: |
(void) | - setRecoveryMode: |
(BOOL) | - queryRecoveryMode |
(void) | - prohibitRecoveryMode |
(BOOL) | - queryRecoveryMode: |
(void) | - toggleParallelDetection: |
(BOOL) | - isDetectorParallel |
Class Methods | |
(ARImageTrackerManager *) | + getInstance |
Properties | |
ARNode * | baseNode |
BOOL | isInitialised |
NSArray * | trackables |
int | numberOfDetectedTrackables |
NSArray * | detectedTrackables |
Manager singleton for the image tracker. The image tracker is capable of detecting pre-registered 2D images within the camera stream.
- (BOOL) addTrackable: | (ARImageTrackable *) | trackable |
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.
Example of use:
trackable | The trackable to add. |
- (void) addTrackableSet: | (ARImageTrackableSet *) | set |
Add a set of trackables to the image tracker so they may be detected.
Example of use:
set | The set of trackables to add. This must be in the .KARMarker format. |
- (void) deinitialise |
Deinitialise the Image Tracker. This method should only be called once during cleanup, ideally when the AR View Controller is being dismissed. When the Image Tracker is denitialised, it performs the following: The native ImageTracker interface is deinitialised. The array of trackables is emptied. The array of detected trackables is emptied, meaning any markers currently being detected will be lost, and any nodes that are currently visible will stop being rendered. The base node is reset with a new ARNode.
Example of use:
- (ARImageTrackable *) findTrackableByName: | (NSString *) | name |
Find a trackable registered with the tracker by its name.
Example of use:
name | The name of the trackable to find. |
+ (ARImageTrackerManager *) getInstance |
Get the Image Tracker singleton.
Example of use:
- (void) initialise |
Initialise the Image Tracker. This method should only be called once during setup. When the Image Tracker is initialised, it performs the following: A new ARNode is created to become the tracker's base node. An empty array of trackables is created. A reference to the native ImageTracker interface is made and the the interface is initialised.
Example of use:
- (BOOL) isDetectorParallel |
Query whether marker detection is parallelised (for simultaneous detection of multiple trackables) or not.
Example of use:
- (void) process: | (NSData *) | data | |
width: | (int) | width | |
height: | (int) | height | |
padding: | (int) | padding | |
Passes Camera data to KudanCV for processing. This is called everyframe.
data | Camera data. |
width | Camera width. |
height | Camera height. |
padding | Camera padding. |
- (void) prohibitRecoveryMode |
Prohibit recovery mode for all trackables (ignoring the global setting).
Example of use:
- (BOOL) queryRecoveryMode |
Query whether recovery mode is on, for all trackables in general. This could be overridden for individual trackables.
Example of use:
- (BOOL) queryRecoveryMode: | (ARImageTrackable *) | trackable |
For an individual trackable, query whether it is able to use recovery mode (depends on the global setting and the trackable's own setting).
Example of use:
globalRecoveryEnabled will return NO. exampleMarkerRecoveryEnabled will return YES.
trackable | The trackable for which recovery mode is being queried. |
- (void) removeTrackable: | (ARImageTrackable *) | trackable |
Remove a trackable from the image tracker. This trackable will no longer be detected.
Example of use:
trackable | The trackable to remove. |
- (void) setMaximumSimultaneousTracking: | (int) | maxToTrack |
Set the maximum number of trackables which can be tracked at the same time. If the maximum number of markers is already being tracked, further markers will not be detected. 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.
NOTE: Tracking multiple trackables at the same time is quite processor intensive and can cause fps drops.
Example of use:
maxToTrack | The maximum number of trackables which can be tracked simultaneously. |
- (void) setRecoveryMode: | (BOOL) | doRecovery |
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.
Example of use:
doRecovery | Whether recovery mode is used (YES) or not (NO). |
- (void) start |
Start the Image Tracker. The Image Tracker must have first been initialised before starting, or it will not work.
Example of use:
- (void) stop |
Stop the Image Tracker. Any visible objects on-screen will stop rendering at this time.
Example of use:
- (void) toggleParallelDetection: | (bool) | isParallel |
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.
Example of use:
isParallel | Set whether detection can run in parallel (YES) or not (NO). |
|
readwritenonatomicassign |
This node is the parent of all trackable worlds. It can be used to toggle visibility of all markers or as a touch target to receive touches on any marker.
|
readatomicassign |
The array of detected ARImageTrackable objects from the last processed frame.
|
readwritenonatomicassign |
Whether the tracker is initialised or not.
|
readatomicassign |
The number of trackables detected in the last processed frame.
|
readatomicassign |
The array of all registered trackables.