This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

trackingCKF

Cubature Kalman filter for object tracking

Description

The trackingCKF object represents a cubature Kalman filter designed for tracking objects that follow a nonlinear motion model or are measured by a nonlinear measurement model. Use the filter to predict the future location of an object, to reduce noise in a measured location, or to help associate multiple object detections with their tracks.

The cubature Kalman filter estimates the uncertainty of the state and the propagation of that uncertainty through the nonlinear state and measurement equations. There are a fixed number of cubature points chosen based on the spherical-radial transformation to guarantee an exact approximation of a Gaussian distribution up to the third moment. As a result, the corresponding filter is the same as an unscented Kalman filter, trackingUKF, with Alpha = 1, Beta = 0, and Kappa = 0.

Creation

Syntax

ckf = trackingCKF
ckf = trackingCKF(transitionFcn,measuremntFcn,state)
ckf = trackingCKF(___,Name,Value)

Description

ckf = trackingCKF returns a cubature Kalman filter object with default state transition function, measurement function, state, and additive noise model.

example

ckf = trackingCKF(transitionFcn,measuremntFcn,state) specifies the StateTranstionFcn, MeasurementFcn, and State properties directly.

ckf = trackingCKF(___,Name,Value) specifies the properties of the Kalman filter using one or more Name,Value pair arguments. Any unspecified properties take default values.

Properties

expand all

Kalman filter state, specified as a real-valued M-element vector.

Example: [200;0.2;150;0.1;0;0.25]

Data Types: double

State error covariance, specified as a positive-definite real-valued M-by-M matrix, where M is the size of the filter state. The covariance matrix represents the uncertainty in the filter state.

Example: eye(6)

State transition function, specified as a function handle. This function calculates the state vector at time step k from the state vector at time step k–1. The function can take additional input parameters, such as control inputs or time step size. The function can also include noise values.

  • If HasAdditiveProcessNoise is true, specify the function using one of these syntaxes:

    x(k) = transitionfcn(x(k-1))
    
    x(k) = transitionfcn(x(k-1),parameters)
    where x(k) is the state at time k. The parameters term stands for all additional arguments required by the state transition function.

  • If HasAdditiveProcessNoise is false, specify the function using one of these syntaxes:

    x(k) = transitionfcn(x(k-1),w(k-1))
    
    x(k) = transitionfcn(x(k-1),w(k-1),parameters)
    where x(k) is the state at time k, and w(k) is a value for the process noise at time k. The parameters argument stands for all additional arguments required by the state transition function.

Example: @constacc

Dependencies

This parameter depends on the HasAdditiveNoise property.

Data Types: function_handle

Process noise covariance:

  • When HasAdditiveProcessNoise is true, specify the process noise covariance as a scalar or a positive-definite real-valued M-by-M matrix. M is the dimension of the state vector. When specified as a scalar, the matrix is a multiple of the M-by-M identity matrix.

  • When HasAdditiveProcessNoise is false, specify the process noise covariance as a Q-by-Q matrix. Q is the size of the process noise vector.

    Specify ProcessNoise before any call to the predict method. In later calls to predict, you can optionally specify the process noise as a scalar. In this case, the process noise matrix is a multiple of the Q-by-Q identity matrix.

Example: [1.0 0.05 0; 0.05 1.0 2.0; 0 2.0 1.0]

Dependencies

This parameter depends on the HasAdditiveNoise property.

Option to model process noise as additive, specified as true or false. When this property is true, process noise is added to the state vector. Otherwise, noise is incorporated into the state transition function.

Measurement model function, specified as a function handle. This function can be a nonlinear function that models measurements from the predicted state. Input to the function is the M-element state vector. The output is the N-element measurement vector. The function can take additional input arguments, such as sensor position and orientation.

  • If HasAdditiveMeasurementNoise is true, specify the function using one of these syntaxes:

    z(k) = measurementfcn(x(k))
    
    z(k) = measurementfcn(x(k),parameters)
    where x(k) is the state at time k, and z(k) is the predicted measurement at time k. The parameters term stands for all additional arguments required by the measurement function.

  • If HasAdditiveMeasurementNoise is false, specify the function using one of these syntaxes:

    z(k) = measurementfcn(x(k),v(k))
    
    z(k) = measurementfcn(x(k),v(k),parameters)
    where x(k) is the state at time k, and v(k) is the measurement noise at time k. The parameters argument stands for all additional arguments required by the measurement function.

Example: @cameas

Dependencies

This parameter depends on the HasAdditiveNoise property.

Data Types: function_handle

Measurement noise covariance:.

  • When HasAdditiveMeasurementNoise is true, specify the measurement noise covariance as a scalar or an N-by-N matrix. N is the size of the measurement vector. When specified as a scalar, the matrix is a multiple of the N-by-N identity matrix.

  • When HasAdditiveMeasurementNoise is false, specify the measurement noise covariance as an R-by-R matrix. R is the size of the measurement noise vector.

    Specify MeasurementNoise before any call to the correct method. After the first call to correct, you can optionally specify the measurement noise as a scalar. In this case, the measurement noise matrix is a multiple of the R-by-R identity matrix.

Example: 0.2

Dependencies

This parameter depends on the HasAdditiveNoise property.

Option to enable additive measurement noise, specified as true or false. When this property is true, noise is added to the measurement. Otherwise, noise is incorporated into the measurement function.

Object Functions

predictPredict state and state estimation error covariance
correctCorrect state and state estimation error covariance
correctjpdaCorrect state and state estimation error covariance using JPDA
distanceDistances between measurements and predicted measurements
residualMeasurement residual and residual noise
likelihoodLikelihood of measurement
cloneCopy filter for object tracking

Examples

collapse all

This example shows how to create and run a trackingCKF filter. Call the predict and correct functions to track an object and correct the state estimation based on measurements.

Create the filter. Specify the constant velocity motion model, the measurement model, and the initial state.

state = [0;0;0;0;0;0];
ckf = trackingCKF(@constvel,@cvmeas,state);

Call predict to get the predicted state and covariance of the filter. Use a 0.5 second time step.

[xPred,pPred] = predict(ckf,0.5);

Call correct with a given measurement.

meas = [1;1;0];
[xCorr,pCorr] = correct(ckf,meas);

Continue to predict the filter state. Specify the desired time step in seconds if necessary.

[xPred,pPred] = predict(ckf);         % Predict over 1 second
[xPred,pPred] = predict(ckf,2);       % Predict over 2 seconds

Extended Capabilities

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

Introduced in R2018b