benchmarks.hota.tracker.build_kalman_tracker
def build_kalman_tracker(height: int, width: int, max_chi2: float = CHI2_GATE, jonker_threshold: float | None = None, q: float = 1.0, r: float = 1.0) -> unitrack.TrackerBuild a constant-velocity centroid Kalman tracker with a motion gate.
The tracklet centroid state is 4-D ``[x, y, vx, vy]`` (predicted forward
each frame); detections carry a 2-D ``[x, y]`` centroid. The association
cost is the Mahalanobis chi-squared distance to the *predicted* centroid
(projected into the 2-D measurement subspace), gated by ``MotionGate`` at
``max_chi2`` and ``ClassGate``. A plain ``CDist("centroid")`` cannot be used
here: the 4-D tracklet mean and 2-D detection mean have mismatched feature
dimensions; ``Mahalanobis`` is the primitive that projects between them.
``max_chi2`` bounds the ``MotionGate`` (pairs with a larger chi-squared
distance are masked out before assignment). ``jonker_threshold`` bounds the
Jonker assignment cost and defaults to ``max_chi2`` (so the gate and the
assignment share one rejection radius, the standard SORT setting); passing a
looser ``jonker_threshold`` isolates the ``MotionGate`` as the sole cause of a
rejection, which the gate-isolation test relies on.
``height`` / ``width`` are accepted for a uniform factory signature but the
Kalman state is resolution-independent (pixel centroids). ``q`` / ``r`` are
sized for pixel-space centroids (process/measurement noise of order one
pixel²), not the normalized-coordinate defaults of ``KalmanCentroid2D``.
Source: unitrack/benchmarks/hota/tracker.py:252