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.

trackingABF

Alpha-beta filter for object tracking

Description

The trackingABF object represents an alpha-beta filter designed for object tracking for an object that follows a linear motion model and has a linear measurement model. Linear motion is defined by constant velocity or constant acceleration. Use the filter to predict the future location of an object, to reduce noise for a detected location, or to help associate multiple objects with their tracks.

Creation

Syntax

abf = trackingABF
abf = trackingABF(Name,Value)

Description

abf = trackingABF returns an alpha-beta filter for a discrete time, 2-D constant velocity system. The motion model is named '2D Constant Velocity' with the state defined as [x; vx; y; vy].

example

abf = trackingABF(Name,Value) specifies the properties of the filter using one or more Name,Value pair arguments. Any unspecified properties take default values.

Properties

expand all

Model of target motion, specified as a character vector or string. Specifying 1D, 2D, or 3D specifies the dimension of the target's motion. Specifying Constant Velocity assumes that the target motion is a constant velocity at each simulation step. Specifying Constant Acceleration assumes that the target motion is a constant acceleration at each simulation step.

Data Types: char | string

Filter state, specified as a real-valued M-element vector. A scalar input is extended to an M-element vector. The state vector is the concatenated states from each dimension. For example, if MotionModel is set to '3D Constant Acceleration', the state vector is in the form:[x; x'; x''; y; y'; y''; z; z'; z''] where ' and '' indicate first and second order derivatives, respectively.

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

Data Types: double

State error covariance, specified as an M-by-M matrix, where M is the size of the filter state. A scalar input is extended to an M-by-M matrix. The covariance matrix represents the uncertainty in the filter state.

Example: eye(6)

Process noise covariance, specified as a scalar or a D-by-D matrix, where D is the dimensionality of motion. For example, if MotionModel is '2D Constant Velocity', then D = 2. A scalar input is extended to a D-by-D matrix.

Example: [20 0.1; 0.1 1]

Measurement noise covariance, specified as a scalar or a D-by-D matrix, where D is the dimensionality of motion. For example, if MotionModel is '2D Constant Velocity', then D = 2. A scalar input is extended to a M-by-M matrix.

Example: [20 0.1; 0.1 1]

Alpha-beta filter coefficients, specified as a scalar or row vector. A scalar input is extended to a row vector. If you specify constant velocity in the MotionModel property, the coefficients are [alpha beta]. If you specify constant acceleration in the MotionModel property, the coefficients are [alpha beta gamma].

Example: [20 0.1]

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 trackingABF filter. Call the predict and correct functions to track an object and correct the state estimation based on measurements.

Create the filter. Specify the initial state.

state = [1;2;3;4];
abf = trackingABF('State',state);

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

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

Call correct with a given measurement.

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

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

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

Modify the filter coefficients and correct again with a new measurement.

abf.Coefficients = [0.4 0.2];
[xCorr,pCorr] = correct(abf,[8;14]);

Extended Capabilities

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

Introduced in R2018b