Model Tracking Occluders

Level: Intermediate

This article introduces the concept and the purpose of tracking occluders. It also explains how to integrate occluders in a VisionLib tracking setup in Unity. We also include a TrackingOccluder example scene in our examples package. You can explore the example scene to supplement the explanations in this article.

When to use Tracking Occluders

Model tracking locates and tracks physical objects using digital 3D models.

Tracking performs best when the 3D model accurately matches the physical object. Small deviations can be tolerated without much impact on tracking performance. Larger deviations, such as missing or displaced parts on the real object, can cause tracking to behave erratically or fail entirely. Particularly if the parts in question make for a significant portion of the object. Wheels, steering wheels and doors on vehicles are good examples for such parts. They are large and move in reality. They often do not align with their counterpart in the digital model and, as a consequence, noticeably impair tracking.

As digital models are often subdivided into components, an obvious workaround might be to delete any offending components from the respective model. However, this exposes model geometry previously occluded by the removed parts. VisionLib will now attempt to track the newly exposed geometry (see the "tires removed entirely" column in the image at the top of the page). This behavior is undesirable since the components removed from the model remain present on the real car, where they still occlude the geometry behind them. Simply deleting moving parts from the tracking model would therefore still leave us with a mismatch between the digital model and the real object.

The Tracking Occluder

To solve the issue described above, we need a way to tell VisionLib not to track certain parts of the tracking model – while at the same time not “looking past” them for any geometry beyond. This is the role of the tracking occluder: Replacement geometry that is not itself tracked, but that occludes tracking geometry behind it.

Ferrari Model Example

The image at the top of the page shows an example of how to use tracking occluders: We would like to track the Ferrari model car – but without its rims, as they are a moving part. Removing the rim or the entire wheel exposes the brakes or the chassis of the car, respectively. Furthermore we would like to keep the tire itself, since its outline does not change with wheel rotation and we can continue to track it as the wheel rotates. Accordingly, the rim (but not the tire) is replaced with a simple cylinder. This cylinder is designated as an occluder. Tracking geometry inside and behind this cylinder is hidden from tracking. We thus obtain a tracking model that supports tracking while the car moves.

Designating Models as Tracking Occluders in Unity

Before you can use a model as a tracking occluder, you must first add it to the scene as described in the section Changing the Model in our quick start guide (UnitySDK Quick Start). Then you can designate it as occluder directly via the inspector of the TrackingMesh component as shown here:

You can also use the tree view in the VLTrackingAnchor's inspector under Tracking Geometry > Scene Hierarchy. This is especially useful if you would like to change the occluder setting of several TrackingMeshes simultaneously. In our TrackingOccluder example scene, we grouped the wheels under a separate parent GameObject (“Wheels”). This way, changing a setting on the parent GameObject via the tree view applies the change to all wheels at the same time (see yellow highlights in the image below). Of course, the tree view also allows you to edit a single TrackingMesh's settings (green highlights).

Rendering Tracking Occluders

The tracking occlusion discussed above is an entirely separate concept from rendering the game view in Unity. Occluder geometry can be visible as part of the augmentation in your project -– or it can be completely hidden. Neither matters to VisionLib. VisionLib only cares about the tracking occluder setting on the TrackingMesh. The image below shows the four possible combinations of tracking occlusion (VisionLib) and mesh rendering (Unity) settings on the dark grey wheels in the TrackingOccluder example scene. If the "tracking occluder" setting is enabled, the portions of the car inside (and behind) the grey wheels are not used for tracking. If "tracking occluder" is disabled, VisionLib tracks the combination of the car and the wheels.

Note: “Tracking Occluder: Off” means the wheels are still part of the tracking target. There are active TrackingMesh components on each wheel in each of the four examples. Removing the wheels from the tracking target by removing/disabling the TrackingMesh components would make them just like any other Unity object unknown to VisionLib's tracking.