主要内容

AlphaBetaFilter

Alpha-beta filter for object tracking

描述

TheAlphaBetaFilterobject represents an alpha-beta filter designed for object tracking. Use this tracker for platforms that follow a linear motion model and have 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

描述

abf= AlphaBetaFiltercreates an alpha-beta filter for a discrete time, 2-D constant velocity system. The motion model of the filter corresponds to setting theMotionModelproperty to'2D Constant Velocity'。在这种情况下,过滤状态采用表单[X;vx;y;vy]

example

abf= Alphabetafilter(名称,值,...)specifies the properties of the filter using one or moreName,Valuepair arguments. Any unspecified properties take default values.

Properties

expand all

目标运动模型, specified as a character vector or string. Specifying1D,2D或者3D设置目标运动的尺寸。指定恒定速度assumes that the target motion has constant velocity at each simulation step. Specifying恒定加速假设目标运动在每个模拟步骤下都具有恒定加速度。

Data Types:char|string

过滤状态, specified as a scalar or a real-valuedM- 元素矢量。标量输入扩展到M- 元素矢量。The state vector is the concatenated states from each dimension.

The state vectors for each motion model are column vectors:

MotionModel属性 国家向量
'1D Constant Velocity' [X;vx]
'2D Constant Velocity' [X;vx;y;vy]
'3D Constant Velocity' [X;vx;y;vy;z; vz]
'1D Constant Acceleration' [X;vx;斧头]
'2D恒定加速度' [X;vx;斧头;y;vy;是]
'3D Constant Acceleration' [X;vx;斧头;y;vy;ay; z; vz; az]

例如,在哪里vx表示速度的x-direction andax表示加速x-方向。

例子:[200; 0.2; 150; 0.1; 0; 0.25]

Data Types:双倍的

State error covariance, specified as anM-经过-Mmatrix whereM是过滤状态的大小。标量输入扩展到M-经过-Mmatrix. The covariance matrix represents the uncertainty in the filter state.

例子:eye(6)

Process noise covariance, specified as a scalar or anD-经过-Dmatrix whereD是the dimensionality of motion. For example, ifMotionModel'2D Constant Velocity, thenD= 2. A scalar input is extended to anD-经过-Dmatrix.

例子:[20 0.1; 0.1 1]

测量噪声协方差,指定为标量或D-经过-Dmatrix whereD是the dimensionality of motion. For example, ifMotionModel'2D Constant Velocity, thenD= 2. A scalar input is extended to anM-经过-Mmatrix.

例子:[20 0.1; 0.1 1]

alpha-beta滤波器系数,指定为真实值的标量或行向量。任何标量输入都扩展到行向量。如果在MotionModelproperty, the coefficients are[alpha beta]。If you specify constant acceleration in theMotionModelproperty, the coefficients are[alpha beta gamma]

例子:[20 0.1]

Object Functions

预测 预测状态和州估计误差协方差
correct Correct the state and state estimation error covariance
distance Distances between measurements and predicted measurements
可能性 Likelihood of measurement
clone Create identical object

例子

全部收缩

应用α-β滤波器以跟踪沿X轴恒定速度移动的目标。

t = 0.1;v0 = 100;n = 100;plat =分阶段。平台('MotionModel','Velocity',。。。'VelocitySource','Input port','初始位置',[100;0;0]); abfilt = phased.AlphaBetaFilter('MotionModel','1D Constant Velocity');Z = zeros(1,N); Zp = zeros(1,N); Zc = zeros(1,N);form = 1:N pos = plat(T,[100+20*randn;0;0]); Z(m) = pos(1); [~,~,Zp(m)] = predict(abfilt,T); [~,~,Zc(m)] = correct(abfilt,Z(m));endt = t (0: n - 1) *;情节(t, Z, t,Zp,t,Zc) xlabel(“时间)”)ylabel('Position (m)') legend(“真轨道”,“预测轨道”,'Corrected Track',。。。'地点','Best')

图包含一个轴对象。轴对象包含3个类型行的对象。这些对象代表真实的轨道,预测的轨道,校正了轨道。

Apply the alpha-beta filter to track a target moving at constant acceleration along the x-axis.

t = 0.1;A0 = 100;n = 100;plat =分阶段。平台('MotionModel','Acceleration',。。。'AccelerationSource','Input port','初始位置',[100;0;0]); abfilt = phased.AlphaBetaFilter(。。。'MotionModel','1D Constant Acceleration',。。。'Coefficients',[0.5 0.5 0.1]); Z = zeros(1,N); Zp = zeros(1,N); Zc = zeros(1,N);form = 1:N pos = plat(T,[100+20*randn;0;0]); Z(m) = pos(1); [~,~,Zp(m)] = predict(abfilt,T); [~,~,Zc(m)] = correct(abfilt,Z(m));endt = t (0: n - 1) *;情节(t, Z, t,Zp,t,Zc) xlabel(“时间)”)ylabel('Position (m)');传奇(“真轨道”,“预测轨道”,'Corrected Track',。。。'地点','Best');

图包含一个轴对象。轴对象包含3个类型行的对象。这些对象代表真实的轨道,预测的轨道,校正了轨道。

应用Alpha-Beta滤波器以在三个维度上以恒定速度移动目标。

t = 0.1;v0 = 100;n = 100;plat =分阶段。平台('MotionModel','Velocity',。。。'VelocitySource','Input port','初始位置',[100;0;0]); abfilt = phased.AlphaBetaFilter('MotionModel',。。。'3D Constant Velocity','状态',zeros(6,1)); Z = zeros(3,N); Zp = zeros(3,N); Zc = zeros(3,N);form = 1:N Z(:,m) = plat(T,[V0+20*randn;0;0]); [~,~,Zp(:,m)] = predict(abfilt,T); [~,~,Zc(:,m)] = correct(abfilt,Z(:,m));endt = t (0: n - 1) *;图(t,z(1,:),t,zp(1,:),t,zc(1,:))xlabel(“时间)”)ylabel('Position along X (m)') legend(“真轨道”,“预测轨道”,'Corrected Track',。。。'地点','Best')

图包含一个轴对象。轴对象包含3个类型行的对象。这些对象代表真实的轨道,预测的轨道,校正了轨道。

Extended Capabilities

C/C ++代码生成
使用MATLAB®CODER™生成C和C ++代码。

Version History

Introduced in R2018b