Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Create Kalman filter for object tracking

`kalmanFilter = configureKalmanFilter(MotionModel,InitialLocation,InitialEstimateError,MotionNoise,MeasurementNoise)`

returns a `kalmanFilter`

= configureKalmanFilter(`MotionModel`

,`InitialLocation`

,`InitialEstimateError`

,`MotionNoise`

,`MeasurementNoise`

)`vision.KalmanFilter`

object
configured to track a physical object. This object moves with constant
velocity or constant acceleration in an * M*-dimensional
Cartesian space. The function determines the number of dimensions,

`InitialLocation`

vector.This function provides a simple approach for configuring the `vision.KalmanFilter`

object
for tracking a physical object in a Cartesian coordinate system. The
tracked object may move with either constant velocity or constant
acceleration. The statistics are the same along all dimensions. If
you need to configure a Kalman filter with different assumptions,
use the `vision.KalmanFilter`

object
directly.

This function provides a simple approach for configuring the
vision.KalmanFilter object for tracking. The Kalman filter implements
a discrete time, linear State-Space System. The `configureKalmanFilter`

function
sets the `vision.KalmanFilter`

object properties.

The `InitialLocation` property
corresponds to the measurement vector used in the Kalman filter state-space
model. This table relates the measurement vector, ,
to the state-space model for the Kalman filter.M | ||

State transition
model, , and Measurement model, AH | ||

The state transition model, of the state-space
model, are set to block diagonal matrices made from H identical
submatrices Ms and As, respectively: H
`blkdiag` (s _1, As
_2, ..., As _A)M
`blkdiag` (s _1, Hs
_2, ..., Hs _H)M | ||

The submatrices s
and As are described below:H | ||

MotionModel | sA | sH |

`‘ConstantVelocity'` | [1 1; 0 1] | [1 0] |

`‘ConstantAcceleration'` | [1 1 0; 0 1 1; 0 0 1] | [1 0 0] |

The Initial
State, :x | ||

MotionModel | Initial
state, x | |

`‘ConstantVelocity'` | [`InitialLocation` (1),
0, ..., `InitialLocation` (),
0] M | |

`‘ConstantAcceleration'` | [`InitialLocation` (1),
0, 0, ..., `InitialLocation` (),
0, 0] M | |

The initial
state estimation error covariance matrix, :P | ||

= P`diag` (`repmat` (`InitialError` ,
[1, ]))M | ||

The process
noise covariance, :Q | ||

= Q`diag` (`repmat` (`MotionNoise` ,
[1, ]))M | ||

The measurement
noise covariance, :R | ||

= R`diag` (`repmat` (`MeasurementNoise` ,
[1, ])).M |

Was this topic helpful?