Efficiently recognizes particular targets in the camera feed.
A TargetFinder identifies Image Targets in the camera feed. It can perform detection and recognition, but is not able to track targets, nor provide any kind of pose.
A TargetFinder allows your application to support the detection and tracking of a dramatically increased number of targets, by acting as a sort of filter mechanism on the tracking environment. Based on the results of a TargetFinder search, your application can selectively enable tracking for individual targets only when those targets are actually present - avoiding expensive and redundant tracking attempts for targets which are not present.
A TargetFinder should be considered to operate asynchronously, offering discrete results outside of the typical State lifecycle:
Obtain a TargetFinder instance from the ObjectTracker by calling ObjectTracker::getTargetFinder().
Public Types | |
enum | { INIT_DEFAULT = 0, INIT_RUNNING = 1, INIT_SUCCESS = 2, INIT_ERROR_NO_NETWORK_CONNECTION = -1, INIT_ERROR_SERVICE_NOT_AVAILABLE = -2 } |
Status codes returned by getInitState() More... | |
enum | { 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 from updateQueryResults() More... | |
enum | { FILTER_NONE = 0, FILTER_CURRENTLY_TRACKED = 1 } |
Filter modes for updateQueryResults() More... | |
Public Member Functions | |
virtual bool | startInit (const char *userAuth, const char *secretAuth)=0 |
Start initialization of the cloud-based recognition system. More... | |
virtual int | getInitState () const =0 |
Get the current state of the initialization process. More... | |
virtual void | waitUntilInitFinished ()=0 |
Block the current thread until initialization is completed. More... | |
virtual bool | deinit ()=0 |
Deinitializes the cloud-based recognition system. More... | |
virtual bool | startRecognition ()=0 |
Start visual recognition. More... | |
virtual bool | stop ()=0 |
Stop visual recognition. More... | |
virtual bool | isRequesting () const =0 |
Get whether the TargetFinder is currently awaiting the results of a query. More... | |
virtual TargetFinderQueryResult | updateQueryResults (int filter=FILTER_CURRENTLY_TRACKED)=0 |
Updates and returns visual search results. More... | |
virtual ObjectTarget * | enableTracking (const TargetSearchResult &result)=0 |
Enable tracking for a particular search result. More... | |
virtual void | clearTrackables ()=0 |
Disable tracking on all previously-enabled search results. More... | |
virtual List< ObjectTarget > | getObjectTargets ()=0 |
Returns a list of ObjectTargets currently enabled for tracking. More... | |
anonymous enum |
Status codes returned by getInitState()
anonymous enum |
Status codes returned from updateQueryResults()
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. |
anonymous enum |
Filter modes for updateQueryResults()
Enumerator | |
---|---|
FILTER_NONE |
No results are filtered, all successful queries are returned. |
FILTER_CURRENTLY_TRACKED |
Filter out targets that are currently being tracked (Most Common) |
|
pure virtual |
Start initialization of the cloud-based recognition system.
Initialize this TargetFinder to recognize Image Targets using cloud-based recognition. Initialization requires a network connection and runs asynchronously. Use getInitState() to query the progress and final result of initialization.
After initialization completes, call startRecognition() to begin continuous recognition of Image Targets in the camera feed. Calls to updateQueryResults() will return search results representing known Image Targets that the cloud-based image recognition system has detected in the camera feed (if any).
userAuth | User name for logging in to the visual search server |
secretAuth | User secret for logging in to the visual search server |
|
pure virtual |
Get the current state of the initialization process.
|
pure virtual |
Block the current thread until initialization is completed.
|
pure virtual |
Deinitializes the cloud-based recognition system.
|
pure virtual |
Start visual recognition.
Starts continuous recognition of Targets in the camera feed.
Use updateQueryResults() to retrieve search matches.
|
pure virtual |
Stop visual recognition.
|
pure virtual |
Get whether the TargetFinder is currently awaiting the results of a query.
|
pure virtual |
Updates and returns visual search results.
Get an updated list of visual search results. Results represent Image Targets. You may want to cast the results to CloudRecoSearchResult for more details.
The visual search process runs asynchronously, and only when recognition is running (i.e. after you call startRecognition()). A call to updateQueryResults() returns the latest available results, which may be several frames out of date with respect to the current camera frame. They should therefore be treated as an indication as to which targets are present in the scene in general, with the understanding that those same targets may not necessarily be visible in the current camera frame.
To enable full tracking on one the targets, pass the matching TargetSearchResult instance to enableTracking().
TargetSearchResult instances are owned by the TargetFinder. Each call to updateQueryResults() invalidates all previously obtained results.
filter | Filter to apply to the search results. If you pass FILTER_CURRENTLY_TRACKED, only search results that are not currently being tracked (i.e. targets that have NOT been enabled for tracking via enableTracking()) will be returned. Pass FILTER_NONE to return all results regardless of current tracking state. |
|
pure virtual |
Enable tracking for a particular search result.
Creates an ObjectTarget for local detection and tracking of a detected target. The pose of this target will be included in State::getTrackableResults().
If this TargetFinder is performing cloud-based image recognition (i.e. if it was initialized via startInit(const char*, const char*), then the returned object will be an instance of ImageTarget.
result | The search result that you want to start tracking. |
|
pure virtual |
Disable tracking on all previously-enabled search results.
Disable and destroy all of the ObjectTargets created via enableTracking().
|
pure virtual |
Returns a list of ObjectTargets currently enabled for tracking.