Skip to content

Quality Metrics

XRTracker exposes several quality metrics that indicate how well tracking is performing. Use these metrics to detect tracking failures, trigger re-detection, and provide user feedback.

Overview

All quality values are normalized to the 0.0 - 1.0 range, where higher is better. Metrics are smoothed over time for stability, preventing single-frame noise from causing false alarms.

Metric Available With What It Measures
Tracking Quality All modalities Overall tracking confidence
Shape Quality Silhouette How tightly the contour matches the expected shape
Depth Quality Depth How closely the depth data aligns with the model surface

Tracking Quality

The main metric to monitor. How it's evaluated depends on the active tracking method:

  • Silhouette — Based on how well the object visually stands out from the background. Higher = clearer separation between object and surroundings.
  • Edge — Based primarily on edge coverage (what fraction of expected edges are successfully matched) and alignment (how closely matched edges follow the model). Coverage is the dominant factor.

When both depth and contour modalities are active, the overall quality uses the best of both.

Shape Quality

Available with silhouette tracking. Measures how consistently the tracked contour matches the expected shape — a tighter, more uniform fit gives higher shape quality.

Info

Shape quality complements tracking quality. An object may have good visual separation from the background (high tracking quality) but a slightly off pose (lower shape quality).

Depth Quality

Available when depth tracking is enabled. Measures how closely the measured depth aligns with the model surface. Higher = better alignment. Near-perfect alignment typically gives quality values above 0.9.

Tracking Status

XRTracker maps quality to a TrackingStatus:

Status Description
NotTracking Not tracking — waiting for detection or tracking was lost
Tracking Actively tracking with good quality
Poor Tracking but quality is below the "nice" threshold

Tracking starts when quality exceeds QualityToStart for a sustained number of frames. Tracking stops when quality drops below QualityToStop.

Default Thresholds

Threshold Silhouette Edge
Quality to Start 0.3 0.65
Quality to Lose 0.4 0.5

You can override these per body using the Custom Start/Stop Threshold options on the TrackedBody inspector.

Using Quality Metrics in Code

var body = GetComponent<TrackedBody>();

// Read quality values
float trackingQuality = body.TrackingQuality;  // 0.0 - 1.0
float shapeQuality = body.ShapeQuality;        // 0.0 - 1.0
float depthQuality = body.DepthTrackingQuality; // 0.0 - 1.0

// React to quality
if (trackingQuality < 0.3f)
{
    // Show "tracking lost" UI
}
else if (trackingQuality > 0.8f)
{
    // High confidence — safe to use the pose for precise operations
}

Tips

  • Tune thresholds for your use case — the defaults work for general scenarios, but specific objects or environments may need adjustment. Use the custom threshold options on TrackedBody.
  • Shape quality is independent from tracking quality — check both when validating tracking. An object can track well but at a slightly wrong pose.
  • For edge tracking, if quality drops significantly, the object is likely occluded or has drifted — consider re-detection
  • Display quality metrics during development using the debug UI to monitor tracking health in real time