trackforge / trackers / common
Module common
Building blocks shared across the trackers.
TrackState is the common confirm/delete lifecycle used by the IoU and
appearance trackers, and KalmanTrack wraps the per-track Kalman state with
the predict/update mechanics they all repeat. cmc holds the shared camera
motion compensation transform.
Quick Reference
| Item | Kind | Description |
|---|---|---|
cmc |
mod | Camera motion compensation (CMC) shared across trackers. |
KalmanTrack |
struct | Per-track Kalman state plus the predict/update steps every tracker repeats. |
TrackState |
enum | Lifecycle state of a track. |
Modules
cmc— Camera motion compensation (CMC) shared across trackers.
Types
CameraMotion
A 2x3 affine camera-motion transform [[a, b, tx], [c, d, ty]].
Maps a previous-frame point (x, y) to (a*x + b*y + tx, c*x + d*y + ty).
The default is the identity (no camera motion).
Fields
| Name | Type | Description |
|---|---|---|
a |
f32 |
Row 0 of the linear part. |
tx |
f32 |
Horizontal translation. |
c |
f32 |
Row 1 of the linear part. |
ty |
f32 |
Vertical translation. |
Implementations
Build a transform from the six affine coefficients.
The identity transform (no camera motion).
Whether this transform is the identity, so application can be skipped.
Warp a Kalman mean and covariance in place.
Warp an XYAH observation [cx, cy, aspect, height] in place.
Trait Implementations
impl<R> ReadPrimitive<R> for CameraMotion
KalmanTrack
struct KalmanTrack {
pub mean: crate::utils::kalman::StateVector,
pub covariance: crate::utils::kalman::CovarianceMatrix,
}
Per-track Kalman state plus the predict/update steps every tracker repeats.
Holds the 8-dimensional mean and covariance and applies the shared
KalmanFilter. The owning track keeps its own box, score, and lifecycle
fields and delegates the filtering to this type.
Fields
| Name | Type | Description |
|---|---|---|
mean |
crate::utils::kalman::StateVector |
Kalman filter state mean ([x, y, a, h, vx, vy, va, vh]). |
covariance |
crate::utils::kalman::CovarianceMatrix |
Kalman filter state covariance. |
Implementations
Initialise the filter from a first measurement in XYAH form.
Run one Kalman prediction step and return the refreshed TLWH box.
Correct the state with a matched measurement in XYAH form.
Warp the Kalman state by a camera motion transform and return the new TLWH box.
Trait Implementations
TrackState
Lifecycle state of a track.
A track starts Tentative, becomes
Confirmed once it has accumulated enough matches, and
is Deleted when it ages out or fails confirmation.
Variants
Tentative
Newly created; not yet confirmed by enough matches.
Confirmed
Confirmed active track returned to callers.
Deleted
Marked for removal.
Trait Implementations