Class KalmanFilter
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
Kalman filter. The class implements standard Kalman filter \url{http://en.wikipedia.org/wiki/Kalman_filter}. However, you can modify KalmanFilter::transitionMatrix, KalmanFilter::controlMatrix and KalmanFilter::measurementMatrix to get the extended Kalman filter functionality.
public class KalmanFilter : DisposableCvObject, IDisposable, ICvPtrHolder
- Inheritance
-
KalmanFilter
- Implements
- Inherited Members
Constructors
KalmanFilter()
the default constructor
public KalmanFilter()
KalmanFilter(int, int, int, int)
the full constructor taking the dimensionality of the state, of the measurement and of the control vector
public KalmanFilter(int dynamParams, int measureParams, int controlParams = 0, int type = 5)
Parameters
Properties
ControlMatrix
control matrix (B) (not used if there is no control)
public Mat ControlMatrix { get; set; }
Property Value
ErrorCovPost
posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k)
public Mat ErrorCovPost { get; set; }
Property Value
ErrorCovPre
priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)At + Q)/
public Mat ErrorCovPre { get; set; }
Property Value
Gain
Kalman gain matrix (K(k)): K(k)=P'(k)Htinv(H*P'(k)*Ht+R)
public Mat Gain { get; set; }
Property Value
MeasurementMatrix
measurement matrix (H)
public Mat MeasurementMatrix { get; set; }
Property Value
MeasurementNoiseCov
measurement noise covariance matrix (R)
public Mat MeasurementNoiseCov { get; set; }
Property Value
ProcessNoiseCov
process noise covariance matrix (Q)
public Mat ProcessNoiseCov { get; set; }
Property Value
StatePost
corrected state (x(k)): x(k)=x'(k)+K(k)(z(k)-Hx'(k))
public Mat StatePost { get; set; }
Property Value
StatePre
predicted state (x'(k)): x(k)=Ax(k-1)+Bu(k)
public Mat StatePre { get; set; }
Property Value
TransitionMatrix
state transition matrix (A)
public Mat TransitionMatrix { get; set; }
Property Value
Methods
Correct(Mat)
updates the predicted state from the measurement
public Mat Correct(Mat measurement)
Parameters
measurementMat
Returns
DisposeUnmanaged()
Releases unmanaged resources
protected override void DisposeUnmanaged()
Init(int, int, int, int)
re-initializes Kalman filter. The previous content is destroyed.
public void Init(int dynamParams, int measureParams, int controlParams = 0, int type = 5)
Parameters
Predict(Mat?)
computes predicted state
public Mat Predict(Mat? control = null)
Parameters
controlMat