Correction of measurement, state, and state estimation error covariance
The Kalman filter object is designed for tracking. You can use it to predict a physical object's future location, to reduce noise in the detected location, or to help associate multiple physical objects with their corresponding tracks. A Kalman filter object can be configured for each physical object for multiple object tracking. To use the Kalman filter, the object must be moving at constant velocity or constant acceleration.
The Kalman filter algorithm involves two steps, prediction and correction (also known as the update step). The first step uses previous states to predict the current state. The second step uses the current measurement, such as object location, to correct the state. The Kalman filter implements a discrete time, linear State-Space System.
Note
To make configuring a Kalman filter easier, you can use theconfigureKalmanFilter
object to configure a Kalman filter. It sets up the filter for tracking a physical object in a Cartesian coordinate system, moving with constant velocity or constant acceleration. The statistics are the same along all dimensions. If you need to configure a Kalman filter with different assumptions, do not use the function, use this object directly.
In the state space system, the state transition model,A, and the measurement model,H, are set as follows:
Variable | Value |
---|---|
A | [1 1 0 0; 0 1 0 0; 0 0 1 1; 0 0 0 1] |
H | [1 0 0 0; 0 0 1 0] |
returns a kalman filter for a discrete time, constant velocity system.kalmanFilter
= Vision.KalmanFilter
additionally configures the control model,B.kalmanFilter
= Vision.KalmanFilter(StateTransitionModel
,MeasurementModel
)
配置Kalman过滤对象属性,指定为一个或多个kalmanFilter
= Vision.KalmanFilter(StateTransitionModel
,MeasurementModel
,ControlModel
,Name,Value
)Name,Value
pair arguments. Unspecified properties have default values.
Use thepredict
andcorrect
functions based on detection results. Use thedistance
function to find the best matches.
检测到跟踪对象时,请使用predict
andcorrect
functions with the Kalman filter object and the detection measurement. Call the functions in the following order:
[...] = predict(kalmanFilter
);[...] =正确(kalmanFilter
,measurement);
When the tracked object is not detected, call thepredict
function, but not thecorrect
function. When the tracked object is missing or occluded, no measurement is available. Set the functions up with the following logic:
[...] = predict(kalmanFilter
);Ifmeasurementexists [...] = correct(kalmanFilter
,measurement);end
If the tracked object becomes available after missing for the pastt-1 contiguous time steps, you can call thepredict
functionttimes. This syntax is particularly useful to process asynchronous video.. For example,
for i = 1:k [...] = predict(kalmanFilter); end [...] = correct(kalmanFilter,measurement)
[1] Welch, Greg, and Gary Bishop,An Introduction to the Kalman Filter, TR 95–041. University of North Carolina at Chapel Hill, Department of Computer Science.
[2] Blackman, S.带有雷达应用的多目标跟踪。Artech House, Inc., pp. 93, 1986.