Main Content

correct

Correction of measurement, state, and state estimation error covariance

Description

[z_corr,x_corr,P_corr] = correct(kalmanFilter,z) returns the correction of measurement, state, and state estimation error covariance. The correction is based on the current measurement z. The object overwrites the internal state and covariance of the Kalman filter with corrected values.

example

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.

Current measurement, specified as an N-element vector.

Version History

Introduced in R2012b