Cloud Recognition
This example shows how to recognize images on a cloud server and then overlay it with augmentations utilizing the CloudTracker
class.
For a better understanding, here are some terms that will be used in the following and other sections of this documentation related to vision-based augmented reality.
Target: An image and its associated extracted data that is used to recognize an image.
Target Collection: A group of
targets
that are searched together. Think of it as a directory, which contains all your images you want to search. The Wikitude SDK can work with two different sorts ofTarget Collections
- On-device Target Collection: a static
wtc
file containing the extracted data of your images. Can consist of up to 1,000 images. - Cloud Target Collection: A target collection stored on the Wikitude server. See
Cloud Archive
below. Can consist of up to 50,000 images.
- On-device Target Collection: a static
Cloud Archive: An archive stored on the server that is optimized for cloud-based recognition. It is generated from a
Target Collection
and is used in combination withCloudTracker
.CloudTracker: Instead of analysing and computing the live camera feed directly on the device like the
ClientTracker
, theCloudTracker
will send the image(s) taken by the camera to the Wikitude Cloud Recognition server. The server will then do the hard work of trying to match the image with your targets in the specified cloud archive. Beside the benefit of searching in large image database using theCloudTracker
instead ofClientTracker
has also a positive impact on the general performance in most cases. Especially when using a large target collection and on older devices.
Cloud tracking in Unity
CloudTracker Prefab
To add a tracker prefab to the scene, simply drag the CloudTracker
prefab into the scene hierarchy.
A CloudTracker
itself needs to know which cloud archive should be loaded. This is done by entering a cloud archive id into the appropriate text field of the cloud tracker script component. To identify the SDK user, the field called client authentication token needs to be entered as well. With those values in place, a cloud tracker knows which image targets have to be search for on the cloud recognition server.
To react on events like successfully loading a cloud archive, you can use the Unity Events listed in in the inspector of the CloudTrakcer
. Using these event is similar to the ones on a client tracker, so please refer to the Client Recognition examples for more information.
To start a server recognition, call the Recognize
or StartContinuousRecognition
methods of the Wikitude.CloudTracker script component. To evaluate the server response and evaluate which target was recognized and which meta information are associated with this particular image target, you can use the OnRecognitionSuccessful
event on the CloudTracker component.
In case a continuous recognition was started, it needs to be stopped after either a image target was recognized or the application is about to quit. You can restart the continuous recognition after the target was lost to start tracking it again. Please see the Cloud Recognition - Continuous Mode
sample for an example on how to do this.
Define custom augmentations
Augmentations are placed exactly like when using a client tracker, so please refer to the Client Recognition examples for more information.