Main Content

initcakf

Create constant-acceleration linear Kalman filter from detection report

Description

example

filter = initcakf(detection) creates and initializes a constant-acceleration linear Kalman filter from information contained in a detection report. For more details, see Algorithms and trackingKF.

Examples

collapse all

Create and initialize a 2-D constant-acceleration linear Kalman filter object from an initial detection report.

Create the detection report from an initial 2-D measurement, (10,−5), of the object position. Assume uncorrelated measurement noise.

detection = objectDetection(0,[10;-5],'MeasurementNoise',eye(2), ...
    'SensorIndex',1,'ObjectClassID',1,'ObjectAttributes',{'Car',5});

Create the new filter from the detection report.

filter = initcakf(detection);

Show the filter state.

filter.State
ans = 6×1

    10
     0
     0
    -5
     0
     0

Show the state transition model.

filter.StateTransitionModel
ans = 6×6

    1.0000    1.0000    0.5000         0         0         0
         0    1.0000    1.0000         0         0         0
         0         0    1.0000         0         0         0
         0         0         0    1.0000    1.0000    0.5000
         0         0         0         0    1.0000    1.0000
         0         0         0         0         0    1.0000

Input Arguments

collapse all

Detection report, specified as an objectDetection object.

Example: detection = objectDetection(0,[1;4.5;3],'MeasurementNoise', [1.0 0 0; 0 2.0 0; 0 0 1.5])

Output Arguments

collapse all

Linear Kalman filter, returned as a trackingKF object.

Algorithms

  • The detection input must contain a 1-D, 2-D, or 3-D position measurement in Cartesian coordinates.

    • For a 1-D position measurement, the function initializes a trackingKF with a 1-D constant acceleration model, in which the state is [x; vx; ax]. The function sets the MotionModel property of the filter as "1D Constant Acceleration".

    • For a 2-D position measurement, the function initializes a trackingKF with a 2-D constant acceleration model, in which the state is [x; vx; ax; y; vy; ay]. The function sets the MotionModel property of the filter as "2D Constant Acceleration".

    • For a 3-D position measurement, the function initializes a trackingKF with a 3-D constant acceleration model, in which the state is [x; vx; ax; y; vy; ay; z; vz; az]. The function sets the MotionModel property of the filter as "3D Constant Acceleration".

    x, y, and z are position coordinates. The function sets these position states same as those in the measurement of the detection. vx, vy, and vz are the corresponding velocity states and the function sets them as 0. ax, ay, and az are the corresponding acceleration states and the function sets these them as 0.

  • The position components of the state error covariance matrix in the initialized trackingKF object are the same as those in the measurement covariance matrix contained in the detection. The velocity and acceleration components of the state error covariance matrix are set to 100 m2/s2 and 100 m4/s4, respectively. The cross components of the state error covariance matrix are set to 0.

  • The function computes the process noise matrix assuming a unit acceleration increment per step following the Weiner-sequence acceleration model.

  • The measurement noise matrix in the initialized filter is the same as that in the detection.

  • You can use this function as the FilterInitializationFcn property of a trackerGNN or trackerTOMHT object.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2018b