trackforge / utils / kalman
Module kalman
Quick Reference
| Item | Kind | Description |
|---|---|---|
KalmanFilter |
struct | A standard Kalman Filter implementation for bounding box tracking. |
CovarianceMatrix |
type | |
MeasurementMatrix |
type | |
MeasurementVector |
type | |
StateVector |
type |
Types
KalmanFilter
A standard Kalman Filter implementation for bounding box tracking.
Ref: "Simple Online and Realtime Tracking with a Deep Association Metric" (DeepSORT)
Implementations
Create a new Kalman Filter instance.
Initiate the Kalman Filter state from a measurement.
# Arguments
| Argument | Description |
|---|---|
measurement |
The initial measurement vector [x, y, a, h]. |
# Returns
A tuple containing the initial Mean vector and Covariance matrix.
fn predict(&self, mean: &StateVector, covariance: &CovarianceMatrix) -> (StateVector, CovarianceMatrix)
Predict the next state of the Kalman Filter.
# Arguments
| Argument | Description |
|---|---|
mean |
The current state mean vector. |
covariance |
The current state covariance matrix. |
# Returns
A tuple containing the predicted Mean vector and Covariance matrix.
fn update(&self, mean: &StateVector, covariance: &CovarianceMatrix, measurement: &MeasurementVector) -> (StateVector, CovarianceMatrix)
Update the Kalman Filter state with a new measurement.
# Arguments
| Argument | Description |
|---|---|
mean |
The predicted state mean vector. |
covariance |
The predicted state covariance matrix. |
measurement |
The new measurement vector [x, y, a, h]. |
# Returns
A tuple containing the updated Mean vector and Covariance matrix.
fn gating_distance(&self, mean: &StateVector, covariance: &CovarianceMatrix, measurements: &[MeasurementVector]) -> Vec<f32>
Calculate the Mahalanobis distance between the track state and measurements.
# Arguments
| Argument | Description |
|---|---|
mean |
The current state mean. |
covariance |
The current state covariance. |
measurements |
A list of measurements to compare against. |
only_position |
If true, only use the position (x, y) components (not implemented). For this implementation, we use the full measurement vector [x, y, a, h]. |
# Returns
A vector of distances, one for each measurement.
Trait Implementations
impl<R> ReadPrimitive<R> for KalmanFilter