Main Content

vision.KalmanFilter.predict

Prediction of measurement

Description

[z_pred,x_pred,P_pred] = predict(kalmanFilter) returns the prediction of measurement, state, and state estimation error covariance at the next time step (e.g., the next video frame). The object overwrites the internal state and covariance of the Kalman filter with the prediction results.

example

[z_pred,x_pred,P_pred] = predict(kalmanFilter,u) additionally lets you specify the control input, u. This syntax applies when you set the control model, B.

Examples

collapse all

Use the predict and correct functions based on detection results.

When the tracked object is detected, use the predict and correct functions with the Kalman filter object and the detection measurement. Call the functions in the following order:

[...] = predict(kalmanFilter);
[...] = correct(kalmanFilter,measurement);

When the tracked object is not detected, call the predict function, but not the correct method. When the tracked object is missing or occluded, no measurement is available. Set the functions up with the following logic:

[...] = predict(kalmanFilter);
If measurement exists
	[...] = correct(kalmanFilter,measurement);
end

If the tracked object becomes available after missing for the past t-1 contiguous time steps, you can call the predict function t times. This syntax is particularly useful to process asynchronous video.. For example,

for i = 1:k
  [...] = predict(kalmanFilter);
end
[...] = correct(kalmanFilter,measurement) 

Input Arguments

collapse all

Kalman filter object.

Control input, specified as an L-element vector.

Version History

Introduced in R2012b