Wikitude Unity Plugin
Public Member Functions | Public Attributes | Properties | List of all members
Wikitude.CloudRecognitionService Class Reference

CloudRecognitionService is used to send image(s) taken by the camera to the Cloud Recognition Service. The server will then do the hard work of trying to match the image with your targets in the specified cloud archive. More...

Inheritance diagram for Wikitude.CloudRecognitionService:
Wikitude.TargetSource

Public Member Functions

void StartContinuousRecognition (double interval)
 Starts a continuous cloud recognition session. More...
 
void StopContinuousRecognition ()
 Stops the current continuous recognition session. More...
 
void Recognize ()
 Triggers a single device/server communication to find out if an image target appears in the current camera frame. More...
 

Public Attributes

OnInitializedEvent OnInitialized = new OnInitializedEvent()
 Called whenever the connection to the recognition service was successfully initialized. More...
 
OnInitializationErrorEvent OnInitializationError = new OnInitializationErrorEvent()
 Called whenever there was an error connecting to the recognition service. More...
 
OnRecognitionResponseEvent OnRecognitionResponse = new OnRecognitionResponseEvent()
 Called whenever the recognition service has successfully processed a frame. Is called even if no actual target was recognized. More...
 
OnRecognitionErrorEvent OnRecognitionError = new OnRecognitionErrorEvent()
 Called whenever there was an error in processing a frame by the recognition service. More...
 
OnInterruptionEvent OnInterruption = new OnInterruptionEvent()
 Called whenever the recognition interval chosen for continuous recognition is too small. It is recommended to restart recognition with the suggested value. More...
 

Properties

string ClientToken [get, set]
 Gets or sets the Client Token that is used to initialize this Cloud Recognition Service and should correspond to the one that is associated with your Wikitude cloud recognition account. Has to be set before OnEnable on the corresponding Image Tracker is called, otherwise it will have no effect. More...
 
string GroupId [get, set]
 Gets or sets the GroupId that should correspond to the one that is associated with your Wikitude cloud recognition account. Has to be set before OnEnable on the corresponding Image Tracker is called, otherwise it will have no effect. More...
 
string TargetCollectionId [get, set]
 Gets or sets the Target Collection Identifier for the collection that should be used for recognition. Has to be set before OnEnable on the corresponding Image Tracker is called, otherwise it will have no effect. More...
 
TrackerManager.CloudRecognitionServerRegion ServerRegion [get, set]
 Gets or sets the desired server region where the recognition service should take place. Has to be set before OnEnable on the corresponding Image Tracker is called, otherwise it will have no effect. More...
 
string CustomServerURL [get, set]
 Gets or sets a custom URL for the cloud recognition server. It is only used if the ServerRegion property is set to Custom. Has to be set before OnEnable on the corresponding Image Tracker is called, otherwise it will have no effect. More...
 

Detailed Description

CloudRecognitionService is used to send image(s) taken by the camera to the Cloud Recognition Service. The server will then do the hard work of trying to match the image with your targets in the specified cloud archive.

When the CloudRecognitionService is created at runtime, make sure that all the relevant properties are set before the OnEnable method is called on the corresponding ImageTracker by Unity. At OnEnable, the native representation is created and all information needs to be available.

Member Function Documentation

◆ Recognize()

void Wikitude.CloudRecognitionService.Recognize ( )
inline

Triggers a single device/server communication to find out if an image target appears in the current camera frame.

This includes capturing the current camera frame, sending it to the cloud recognition service, evaluating the frame and sending back the response.

If the server could process the camera frame, OnRecognitionResponse is called, independent of the evaluation result.

If no connection to the server could be established or any other problem occurred, OnRecognitionerror is called, providing more information about what went wrong.

◆ StartContinuousRecognition()

void Wikitude.CloudRecognitionService.StartContinuousRecognition ( double  interval)
inline

Starts a continuous cloud recognition session.

Calling this method does essentially the same as a single call to recognize(), but repeats this with the given interval. If the given interval is too short and the previous request hasn't finished when the next one should be send, the interruption handler is called with a newly suggested interval.

So within the interruption handler, the current continuous recognition session should be stopped and started again with the given interval. If not, requests will be dropped.

Parameters
intervalInterval at which new images are sent to the service.

◆ StopContinuousRecognition()

void Wikitude.CloudRecognitionService.StopContinuousRecognition ( )
inline

Stops the current continuous recognition session.

Calling this method will immediately stop any new device/server communication but still deliver the result from any currently ongoing, device/server communication.

Member Data Documentation

◆ OnInitializationError

OnInitializationErrorEvent Wikitude.CloudRecognitionService.OnInitializationError = new OnInitializationErrorEvent()

Called whenever there was an error connecting to the recognition service.

Parameters
errorThe error describing what went wrong.

◆ OnInitialized

OnInitializedEvent Wikitude.CloudRecognitionService.OnInitialized = new OnInitializedEvent()

Called whenever the connection to the recognition service was successfully initialized.

◆ OnInterruption

OnInterruptionEvent Wikitude.CloudRecognitionService.OnInterruption = new OnInterruptionEvent()

Called whenever the recognition interval chosen for continuous recognition is too small. It is recommended to restart recognition with the suggested value.

Parameters
suggestedIntervalThe suggested interval that should be used when restaring continuous recognition.

◆ OnRecognitionError

OnRecognitionErrorEvent Wikitude.CloudRecognitionService.OnRecognitionError = new OnRecognitionErrorEvent()

Called whenever there was an error in processing a frame by the recognition service.

Parameters
errorThe error describing what went wrong.

◆ OnRecognitionResponse

OnRecognitionResponseEvent Wikitude.CloudRecognitionService.OnRecognitionResponse = new OnRecognitionResponseEvent()

Called whenever the recognition service has successfully processed a frame. Is called even if no actual target was recognized.

Parameters
cloudRecognitionServiceResponseContains information on whether a target was recognized and additional information about the target.

Property Documentation

◆ ClientToken

string Wikitude.CloudRecognitionService.ClientToken
getset

Gets or sets the Client Token that is used to initialize this Cloud Recognition Service and should correspond to the one that is associated with your Wikitude cloud recognition account. Has to be set before OnEnable on the corresponding Image Tracker is called, otherwise it will have no effect.

◆ CustomServerURL

string Wikitude.CloudRecognitionService.CustomServerURL
getset

Gets or sets a custom URL for the cloud recognition server. It is only used if the ServerRegion property is set to Custom. Has to be set before OnEnable on the corresponding Image Tracker is called, otherwise it will have no effect.

◆ GroupId

string Wikitude.CloudRecognitionService.GroupId
getset

Gets or sets the GroupId that should correspond to the one that is associated with your Wikitude cloud recognition account. Has to be set before OnEnable on the corresponding Image Tracker is called, otherwise it will have no effect.

◆ ServerRegion

TrackerManager.CloudRecognitionServerRegion Wikitude.CloudRecognitionService.ServerRegion
getset

Gets or sets the desired server region where the recognition service should take place. Has to be set before OnEnable on the corresponding Image Tracker is called, otherwise it will have no effect.

◆ TargetCollectionId

string Wikitude.CloudRecognitionService.TargetCollectionId
getset

Gets or sets the Target Collection Identifier for the collection that should be used for recognition. Has to be set before OnEnable on the corresponding Image Tracker is called, otherwise it will have no effect.