Class KalmanFilter
The class implements a standard Kalman filter. However, you can modify transitionMatrix, controlMatrix, and measurementMatrix to get an extended Kalman filter functionality.
public class KalmanFilter : UnmanagedObject, IDisposable
- Inheritance
-
KalmanFilter
- Implements
- Inherited Members
Constructors
KalmanFilter(int, int, int, DepthType)
Initializes a new instance of the KalmanFilter class.
public KalmanFilter(int dynamParams, int measureParams, int controlParams, DepthType type = DepthType.Cv32F)
Parameters
dynamParams
intDimensionality of the state.
measureParams
intDimensionality of the measurement.
controlParams
intDimensionality of the control vector.
type
DepthTypeType of the created matrices that should be Cv32F or Cv64F
Properties
ControlMatrix
Control matrix (B) (not used if there is no control)
public Mat ControlMatrix { get; }
Property Value
- Mat
The result
ErrorCovPost
posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k)
public Mat ErrorCovPost { get; }
Property Value
- Mat
The result
ErrorCovPre
priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)
public Mat ErrorCovPre { get; }
Property Value
- Mat
The result
Gain
Kalman gain matrix (K(k)): K(k)=P'(k)Htinv(H*P'(k)*Ht+R)
public Mat Gain { get; }
Property Value
- Mat
The result
MeasurementMatrix
Measurement matrix (H)
public Mat MeasurementMatrix { get; }
Property Value
- Mat
The result
MeasurementNoiseCov
Measurement noise covariance matrix (R)
public Mat MeasurementNoiseCov { get; }
Property Value
- Mat
The result
ProcessNoiseCov
Process noise covariance matrix (Q)
public Mat ProcessNoiseCov { get; }
Property Value
- Mat
The result
StatePost
Corrected state (x(k)): x(k)=x'(k)+K(k)(z(k)-Hx'(k))
public Mat StatePost { get; }
Property Value
- Mat
The result
StatePre
Predicted state (x'(k)): x(k)=Ax(k-1)+Bu(k)
public Mat StatePre { get; }
Property Value
- Mat
The result
TransitionMatrix
State transition matrix (A)
public Mat TransitionMatrix { get; }
Property Value
- Mat
The result
Methods
Correct(Mat)
Updates the predicted state from the measurement.
public Mat Correct(Mat measurement)
Parameters
measurement
MatThe measured system parameters
Returns
- Mat
The updated predicted state
DisposeObject()
Release the unmanaged resources
protected override void DisposeObject()
Predict(Mat)
Perform the predict operation using the option control input
public Mat Predict(Mat control = null)
Parameters
control
MatThe control.
Returns
- Mat
The predicted state.