C++ Java Unity
Unity Reference
TargetFinder Class Referenceabstract

This class represents a service that retrieves targets using image and/or model recognition. More...

Inheritance diagram for TargetFinder:
ImageTargetFinder

Classes

class  CloudRecoSearchResult
 CloudReco search result that contains all known data of a specific search result More...
 
class  TargetSearchResult
 Base class for a TargetFinder result More...
 

Public Types

enum  FilterMode {
  FILTER_NONE = 0,
  FILTER_CURRENTLY_TRACKED = 1
}
 Filter modes to be passed into Update() function More...
 
enum  InitState {
  INIT_DEFAULT = 0,
  INIT_RUNNING = 1,
  INIT_SUCCESS = 2,
  INIT_ERROR_NO_NETWORK_CONNECTION = -1,
  INIT_ERROR_SERVICE_NOT_AVAILABLE = -2,
  INIT_ERROR_DEVICE_DATABASE_ERROR = -3
}
 Status codes returned by the init() function More...
 
enum  UpdateState {
  UPDATE_NO_MATCH = 0,
  UPDATE_NO_REQUEST = 1,
  UPDATE_RESULTS_AVAILABLE = 2,
  UPDATE_ERROR_AUTHORIZATION_FAILED = -1,
  UPDATE_ERROR_PROJECT_SUSPENDED = -2,
  UPDATE_ERROR_NO_NETWORK_CONNECTION = -3,
  UPDATE_ERROR_SERVICE_NOT_AVAILABLE = -4,
  UPDATE_ERROR_BAD_FRAME_QUALITY = -5,
  UPDATE_ERROR_UPDATE_SDK = -6,
  UPDATE_ERROR_TIMESTAMP_OUT_OF_RANGE = -7,
  UPDATE_ERROR_REQUEST_TIMEOUT = -8
}
 Status codes returned by the Update() function More...
 

Public Member Functions

void ClearTrackables (bool destroyGameObjects=true)
 Clears all targets enabled for tracking More...
 
bool Deinit ()
 Deinitializes the cloud-based recognition system More...
 
TrackableBehaviour EnableTracking (TargetSearchResult result, string gameObjectName)
 Enable this search result for tracking More...
 
TrackableBehaviour EnableTracking (TargetSearchResult result, GameObject gameObject)
 Enable this search result for tracking. More...
 
InitState GetInitState ()
 Returns the current state of the initialization process More...
 
IEnumerable< ObjectTargetGetObjectTargets ()
 Returns the Object Targets currently enabled for tracking. More...
 
IEnumerable< TargetSearchResultGetResults ()
 Returns new search results More...
 
bool IsRequesting ()
 Returns true if the TargetFinder is in 'requesting' mode More...
 
bool StartRecognition ()
 Starts cloud recognition More...
 
bool Stop ()
 Stops cloud recognition More...
 
UpdateState Update ()
 Update cloud reco results More...
 
UpdateState Update (FilterMode filterMode)
 Update cloud reco results More...
 

Detailed Description

This class represents a service that retrieves targets using image and/or model recognition.

Member Enumeration Documentation

enum FilterMode
strong

Filter modes to be passed into Update() function

Enumerator
FILTER_NONE 

No results are filtered, all successful queries are returned

FILTER_CURRENTLY_TRACKED 

Filter out targets that are currently active (Most Common)

enum InitState
strong

Status codes returned by the init() function

Enumerator
INIT_DEFAULT 

Initialization has not started

INIT_RUNNING 

Initialiation is running

INIT_SUCCESS 

Initialization completed successfully

INIT_ERROR_NO_NETWORK_CONNECTION 

No network connection

INIT_ERROR_SERVICE_NOT_AVAILABLE 

Service is not available

INIT_ERROR_DEVICE_DATABASE_ERROR 

Error loading the device database

enum UpdateState
strong

Status codes returned by the Update() function

Enumerator
UPDATE_NO_MATCH 

No matches since the last update

UPDATE_NO_REQUEST 

No recognition request since the last update

UPDATE_RESULTS_AVAILABLE 

New search results have been found

UPDATE_ERROR_AUTHORIZATION_FAILED 

Credentials are wrong or outdated

UPDATE_ERROR_PROJECT_SUSPENDED 

The specified project was suspended.

UPDATE_ERROR_NO_NETWORK_CONNECTION 

Device has no network connection

UPDATE_ERROR_SERVICE_NOT_AVAILABLE 

Server not found, down or overloaded.

UPDATE_ERROR_BAD_FRAME_QUALITY 

Low-frame quality has been continuously observed

UPDATE_ERROR_UPDATE_SDK 

SDK Version outdated.

UPDATE_ERROR_TIMESTAMP_OUT_OF_RANGE 

Client/Server clocks too far away.

UPDATE_ERROR_REQUEST_TIMEOUT 

No response to network request after timeout.

Member Function Documentation

void ClearTrackables ( bool  destroyGameObjects = true)

Clears all targets enabled for tracking

Destroys all Trackables that have been created via EnableTracking().

bool Deinit ( )

Deinitializes the cloud-based recognition system

TrackableBehaviour EnableTracking ( TargetSearchResult  result,
string  gameObjectName 
)

Enable this search result for tracking

Creates an ImageTarget for local detection and tracking of this target and returns a new ImageTargetBehaviour attached to a new game object with the given name. Note that this call may result in an earlier ImageTarget that was enabled for tracking to be destroyed, including its ImageTargetBehaviour. Thus it is not advised to hold a pointer to an ealier created ImageTarget after calling enableTracking again. Returns NULL if the target failed to be enabled for tracking.

TrackableBehaviour EnableTracking ( TargetSearchResult  result,
GameObject  gameObject 
)

Enable this search result for tracking.

Creates an ObjectTarget for local detection and tracking of this target. If the given game object has no ObjectTargetBehaviour, a new one will be created. Note that this call may result in an earlier ObjectTarget that was enabled for tracking to be destroyed, including its ObjectTargetBehaviour. Thus it is not advised to hold a pointer to an ealier created ObjectTarget after calling enableTracking again. Returns NULL if the target failed to be enabled for tracking.

InitState GetInitState ( )

Returns the current state of the initialization process

Returns INIT_SUCCESS if the cloud-based recognition system was initialized successfully. Initialization requires a network connection to be available on the device, otherwise INIT_ERROR_NO_NETWORK_CONNECTION is returned. If the cloud-based recognition service is not available this function will return INIT_ERROR_SERVICE_NOT_AVAILABLE. Returns INIT_DEFAULT if initialization has not been started. Returns INIT_RUNNING if the initialization process has not completed.

IEnumerable<ObjectTarget> GetObjectTargets ( )

Returns the Object Targets currently enabled for tracking.

IEnumerable<TargetSearchResult> GetResults ( )

Returns new search results

Earlier search result instances are destroyed when Update() is called.

bool IsRequesting ( )

Returns true if the TargetFinder is in 'requesting' mode

When in 'requesting' mode the TargetFinder has issued a search query to the recognition server and is waiting for the results.

bool StartRecognition ( )

Starts cloud recognition

Starts continuous recognition of Targets from the cloud. Use Update() and GetResults() to retrieve search matches.

bool Stop ( )

Stops cloud recognition

UpdateState Update ( )

Update cloud reco results

Clears and rebuilds the list of target search results with results found since the last call to Update(). Also refreshes the IsRequesting flag. Returns the status code UPDATE_RESULTS_AVAILABLE if new search results have been found.

UpdateState Update ( FilterMode  filterMode)

Update cloud reco results

Clears and rebuilds the list of target search results with results found since the last call to Update(). Also refreshes the IsRequesting flag. Returns the status code UPDATE_RESULTS_AVAILABLE if new search results have been found.