# Cloud Recognition
The Wikitude Cloud Recognition service is a cloud-based service provided by Wikitude, which recognizes images sent from a mobile device using the Wikitude SDK. The recognized images are then tracked in the live camera feed and can be used for augmented reality experiences.
The documentation for cloud recognition is split into two parts
- Documentation of the server-side component (Studio and Studio API)
- Documentation of the SDK side implementation, which follows below in more detail
Server-side documentation - Studio
Make sure to read the documentation about Studio and Studio API when using cloud recognition feature.
# Cloud Recognition Sample
This example shows how to recognize images on a cloud server and then overlay it with augmentations utilizing the ImageTracker
and CloudRecognitionService
classes.
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 withCloudRecognitionService
.CloudRecognitionService: Instead of analysing and computing the live camera feed directly on the device, the
CloudRecognitionService
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. Besides the benefit of searching in a large image database, using theCloudRecognitionService
has also a positive impact on the general performance in most cases. Especially when using a large target collection and on older devices.
# Cloud recognition in Unity
# Cloud Recognition with ImageTracker
To add cloud tracking to your scene, simply create a new GameObject
, add the ImageTracker
script to it and select the CloudRecognitionService
instead of the TargetCollectionResource
in the Target Source
field.
A CloudRecognitionService
needs to know which cloud archive should be loaded. This is done by entering a TargetCollectionId
into the appropriate text field of the ImageTracker
script component, in the CloudRecognitionService
section. To identify the SDK user, the field called ClientToken
needs to be entered as well. With those values in place, the CloudRecognitionService
knows which image targets have to be searched 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 ImageTracker
. Please refer to the Image Recognition examples for more information on how to use UnityEvents
. When the ImageTracker
is using the CloudRecognitionService
additional events that are specific to it are shown in the inspector.
To start a server recognition, call the Recognize
or StartContinuousRecognition
methods of the Wikitude.CloudRecognitionService
script assigned to the ImageTracker
. 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 OnRecognitionResponse
event on the ImageTracker
component, in the Cloud Recognition Service Events
section.
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 normal ImageTracker
, so please refer to the Image Recognition examples for more information.