Class CloudRecognitionService
Represents a connection to the Wikitude cloud recognition servers that was initialized with a client token and a target collection id
Cloud recognition services use a cloud target collection which can be created using a REST JavaScript API or the Wikitude Target Manager. Once such a cloud target collection id was created, it can be loaded using a cloud recognition service.
The cloud recognition service requires a continuous internet connection in order to communicate with the Wikitude cloud recognition server.
Inheritance
Namespace: wikitude.sdk.uwp
Assembly: wikitude.sdk.dll
Syntax
public sealed class CloudRecognitionService
Methods
getGroupId()
Represents the groupId that was used to initialize this cloud recognition service and should correspond to the one that is associated with your Wikitude cloud recognition account.
Declaration
public string getGroupId()
Returns
Type | Description |
---|---|
System.String |
Remarks
In case the cloud recognition service was created with an API that did not specify a group id explicitly, this method returns an empty string
getTargetCollectionId()
Represents the target collection id that was used to initialize this cloud recognition service and should correspond to the target collection that should be loaded on the Wikitude cloud recognition server.
Declaration
public string getTargetCollectionId()
Returns
Type | Description |
---|---|
System.String |
getToken()
Represents the client token that was used to initialize this cloud recognition service and should correspond to the one that is associated with your Wikitude cloud recognition account.
Declaration
public string getToken()
Returns
Type | Description |
---|---|
System.String |
isLoaded()
Represents if the communication with the cloud recognition servers could be initialized or not.
Declaration
public bool isLoaded()
Returns
Type | Description |
---|---|
System.Boolean |
load(LoadCompletionHandler)
Forces a manual load of the cloud target collection.
Declaration
public void load(LoadCompletionHandler completionHandler_)
Parameters
Type | Name | Description |
---|---|---|
LoadCompletionHandler | completionHandler_ |
recognize(RecognitionHandler)
Triggers a single device/server communication to find out if a image target occurs in the current camera frame
Declaration
public void recognize(RecognitionHandler recognitionHandler)
Parameters
Type | Name | Description |
---|---|---|
RecognitionHandler | recognitionHandler | A delegate that handles events regarding the device/server communication |
Remarks
This method can be used to trigger a single cloud recognition session. This includes capturing the current camera frame, sending it to the Wikitude cloud recognition server, evaluate the frame and sending back the response. If the server could process the camera frame, the recognitionHandler is called with a nonnull value for the response parameter, independent of the evaluation result. One can use this parameter, of type RecognitionHandler, to retrieve more information about the server processing. If no connection to the server could be established or any other problem occured, the first parameter of the recognitionHandler will be null and the second parameter will contain a valid Error reference with more information about what went wrong.
startContinuousRecognitionWithInterval(UInt32, InterruptionHandler, RecognitionHandler)
Starts a continuous cloud recognition session
Declaration
public void startContinuousRecognitionWithInterval(uint milliseconds_, InterruptionHandler interruptionHandler, RecognitionHandler recognitionHandler)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | milliseconds_ | The interval in which new camera frames should be send to the Wikitude cloud recognition server |
InterruptionHandler | interruptionHandler | A delegate that is invoked every time the given interval is to short in order to process one request after the other. |
RecognitionHandler | recognitionHandler | A delegate that handles events regarding the device/server communication |
Remarks
Calling this method does essentially the same as a single call to -recognize:errorHandler, 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.
stopContinuousRecognition()
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
Declaration
public void stopContinuousRecognition()