public class CVMKalmanFilter extends Object
Constructor and Description |
---|
CVMKalmanFilter(double[] X0,
double initStateCovariance,
double positionProcessStd,
double velocityProcessStd,
double positionMeasurementStd)
Initialize a new Kalman filter with the specified initial state.
|
Modifier and Type | Method and Description |
---|---|
int |
getNOcclusion()
Returns the number of occlusion events that occurred since the
instantiation of this filter.
|
double |
getPositionError()
Return the root mean square error on position estimated through the state
covariance matrix.
|
double |
getVelocityError()
Return the root mean square error on velocity estimated through the state
covariance matrix.
|
double[] |
predict()
Runs the prediction step of the Kalman filter and returns the state
predicted by the evolution process.
|
void |
update(double[] Xm)
Runs the update step of the Kalman filter based on the specified
measurement.
|
public CVMKalmanFilter(double[] X0, double initStateCovariance, double positionProcessStd, double velocityProcessStd, double positionMeasurementStd)
X0
- initial state estimate. Must a 6 elements
double[]
array with
x0, y0, z0, vx0, vy0, vz0
with velocity in
length/frame
units.initStateCovariance
- the initial state covariance. Give it a large value if you do
not trust the initial state estimate (e.g. 100), a
small value otherwise (e.g.1e-2).positionProcessStd
- the std of the additive white gaussian noise affecting the
position evolution. Large values means that the
position undergoes heavy fluctuations.velocityProcessStd
- the std of the additive white gaussian noise affecting the
velocity evolution. Careful, we expect it to be in
units of length/frame
. Large values means that
the velocity undergoes heavy fluctuations.positionMeasurementStd
- the std of the additive white gaussian noise affecting the
position measurement. Large values means that the
positions measured are not accurate.public double[] predict()
double[]
of 6 elements containing the
predicted state: x, y, z, vx, vy, vz
with velocity
in length/frame
units.public void update(double[] Xm)
Xm
- the measured position, must be specified as a 3 elements
double[]
array, containing the measured
x, y, z
position. It can be null
;
the filter then assumes an occlusion occurred, and update its
state based on solely the prediction step.public double getPositionError()
public double getVelocityError()
length/frame
units.public int getNOcclusion()
Copyright © 2015–2021 Fiji. All rights reserved.