# configureKalmanFilter

Create Kalman filter for object tracking

## Description

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, *M*,
from the length of the `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.

## Examples

## Input Arguments

## Output Arguments

## Algorithms

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, M,
to the state-space model for the Kalman filter. | ||

State transition
model, A, and Measurement model, H | ||

The state transition model,
| ||

The submatrices As
and Hs are described below: | ||

MotionModel | As | Hs |

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

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

The Initial
State, x: | ||

MotionModel | Initial
state, x | |

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

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

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])). |

## Version History

**Introduced in R2012b**