Object Tracking
Introduction to Object and Scene Recognition
Object Recognition and Tracking extend the capabilities of the Wikitude SDK to recognize and track arbitrary objects for augmented reality experiences. The feature is based on Wikitude's SLAM engine that is used throughout the SDK for any kind of tracking the environment. Object Recognition and Tracking let you detect objects and entire scenes, that were pre-defined by you. Suitable objects include
- Toys
- Monuments and statues
- Industrial objects
- Tools
- Household supplies
Recognition works best for objects that have only a limited number of changing/dynamic parts.
Scene Recognition
With version SDK 8 the object recognition engine can also be used to recognize larger structures that go beyond table-sized objects. The name Scene recognition reflects this in particular. The new image-based conversion method allows for Object targets that are a lot larger in size, that can be successfully recognized and tracked.
- Rooms
- Face of buildings
- Squares and courtyards
Make sure to read the chapter on how to create Object Targets before using Object Recognition on your own.
Object Tracking in Unity HoloLens
Before proceeding with the Object Tracking sample, please make sure you are familiar with how Image Tracking works first by reading about the Image Tracking samples. Most concepts described there work in a similar way for Object Tracking.
ObjectTracker Prefab
To add a tracker prefab to the scene, simply drag the ObjectTracker
prefab into the scene hierarchy.
An ObjectTracker
itself needs a Wikitude Object Collection (.wto file) which contains information needed to detect the reference objects. Target collections can be generated and downloaded from Wikitude Studio - a free web-based tool, that you can access with your developer account. You can use the .wto file in the same way as .wtc files are used for the ImageTracker
.
Recognition events also work exactly like recognition events for the ImageTracker
.
Define custom augmentations
The process of defining an augmentation for Object Tracking
is exactly the same as for Image Tracking
. The ObjectTrackable
has a Drawable
field that should be set to the prefab that should be instantiated at the location where the object was found in the world.
In the Object Tracking - Object Tracking
scene, this Drawable
prefab workflow is illustrated. A FiretruckAugmentation
prefab was created in the SamplePrefabs
folder and assigned to the ObjectTrackable
. The transform of the prefab has been modified so that the augmentations will match the real object during tracking.
Within the FiretruckAugmentation
prefab you will also find the FiretruckOccluder
GameObject which contains two meshes that are used as occluders. You can read more about occluders and how they work in Unity here.