|
OSSIA
Open Scenario System for Interactive Application
|
Scalar constant-velocity Kalman filter, one axis of a tracked point. More...
Scalar constant-velocity Kalman filter, one axis of a tracked point.
State is [position, velocity]; the measurement is the position alone. Velocity is in units per second.
Classes | |
| struct | process_noise |
| Discrete process noise covariance for one predict step. More... | |
Public Member Functions | |
| OSSIA_INLINE void | initiate (float p0, float var_p, float var_v) noexcept |
Start tracking at p0 with the given initial variances. | |
| OSSIA_INLINE void | predict (float dt, const process_noise &q) noexcept |
Propagate the state dt seconds forward. | |
| OSSIA_INLINE void | update (float z, float r) noexcept |
| Fold in a position measurement. | |
| OSSIA_INLINE float | gating_distance2 (float z, float r) const noexcept |
Static Public Member Functions | |
| static OSSIA_INLINE process_noise | cwna (float sigma_a, float dt) noexcept |
| Discretised continuous-white-noise-acceleration process noise. | |
| static OSSIA_INLINE process_noise | diagonal (float std_p, float std_v, float time_ratio) noexcept |
| Ad-hoc diagonal process noise, dt-scaled. | |
Public Attributes | |
| float | p {} |
| State: position and velocity (units, units/s). | |
| float | v {} |
| float | P00 {} |
| Covariance, symmetric 2x2: [[P00, P01], [P01, P11]]. | |
| float | P01 {} |
| float | P11 {} |
|
inlinestaticnoexcept |
Discretised continuous-white-noise-acceleration process noise.
Q = q * [[dt^3/3, dt^2/2], [dt^2/2, dt]], with q = sigma_a^2.
| sigma_a | Acceleration magnitude of the tracked motion. Human motion peaks around 2 m/s^2; fitting that as 3 sigma gives ~0.67 as a default in metric spaces. (Strictly q is a power spectral density in units^2/s^3; treating sigma_a^2 as its value is the usual shortcut.) |
| dt | Time step in seconds. |
|
inlinestaticnoexcept |
Ad-hoc diagonal process noise, dt-scaled.
For filters tuned with per-frame standard deviations (ByteTrack's std_weight_position / std_weight_velocity): pass the per-second equivalents and the reference-relative time ratio; reproduces the historical diagonal exactly at the reference rate while still growing with elapsed time.
| std_p | Position process std for one reference-length step. |
| std_v | Velocity process std for one reference-length step. |
| time_ratio | dt / reference_dt. |
|
inlinenoexcept |
Fold in a position measurement.
| z | Measured position. |
| r | Measurement variance (std^2). |
|
inlinenoexcept |
Squared Mahalanobis distance of measurement z, in measurement space. Chi-square distributed with 1 DOF; sum over axes for N DOF.