Class KalmanFilter
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.
Implements
Inherited Members
Namespace: OpenCvSharp
Assembly: OpenCvSharp.dll
Syntax
public class KalmanFilter : DisposableCvObject, ICvPtrHolder
Constructors
| Improve this Doc View SourceKalmanFilter()
the default constructor
Declaration
public KalmanFilter()
KalmanFilter(Int32, Int32, Int32, Int32)
the full constructor taking the dimensionality of the state, of the measurement and of the control vector
Declaration
public KalmanFilter(int dynamParams, int measureParams, int controlParams = 0, int type = default(int))
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | dynamParams | |
System.Int32 | measureParams | |
System.Int32 | controlParams | |
System.Int32 | type |
Properties
| Improve this Doc View SourceControlMatrix
control matrix (B) (not used if there is no control)
Declaration
public Mat ControlMatrix { get; set; }
Property Value
Type | Description |
---|---|
Mat |
ErrorCovPost
posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k)
Declaration
public Mat ErrorCovPost { get; set; }
Property Value
Type | Description |
---|---|
Mat |
ErrorCovPre
priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)At + Q)/
Declaration
public Mat ErrorCovPre { get; set; }
Property Value
Type | Description |
---|---|
Mat |
Gain
Kalman gain matrix (K(k)): K(k)=P'(k)Htinv(H*P'(k)*Ht+R)
Declaration
public Mat Gain { get; set; }
Property Value
Type | Description |
---|---|
Mat |
MeasurementMatrix
measurement matrix (H)
Declaration
public Mat MeasurementMatrix { get; set; }
Property Value
Type | Description |
---|---|
Mat |
MeasurementNoiseCov
measurement noise covariance matrix (R)
Declaration
public Mat MeasurementNoiseCov { get; set; }
Property Value
Type | Description |
---|---|
Mat |
ProcessNoiseCov
process noise covariance matrix (Q)
Declaration
public Mat ProcessNoiseCov { get; set; }
Property Value
Type | Description |
---|---|
Mat |
StatePost
corrected state (x(k)): x(k)=x'(k)+K(k)(z(k)-Hx'(k))
Declaration
public Mat StatePost { get; set; }
Property Value
Type | Description |
---|---|
Mat |
StatePre
predicted state (x'(k)): x(k)=Ax(k-1)+Bu(k)
Declaration
public Mat StatePre { get; set; }
Property Value
Type | Description |
---|---|
Mat |
TransitionMatrix
state transition matrix (A)
Declaration
public Mat TransitionMatrix { get; set; }
Property Value
Type | Description |
---|---|
Mat |
Methods
| Improve this Doc View SourceCorrect(Mat)
updates the predicted state from the measurement
Declaration
public Mat Correct(Mat measurement)
Parameters
Type | Name | Description |
---|---|---|
Mat | measurement |
Returns
Type | Description |
---|---|
Mat |
DisposeUnmanaged()
Releases unmanaged resources
Declaration
protected override void DisposeUnmanaged()
Overrides
| Improve this Doc View SourceInit(Int32, Int32, Int32, Int32)
re-initializes Kalman filter. The previous content is destroyed.
Declaration
public void Init(int dynamParams, int measureParams, int controlParams = 0, int type = default(int))
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | dynamParams | |
System.Int32 | measureParams | |
System.Int32 | controlParams | |
System.Int32 | type |
Predict(Mat)
computes predicted state
Declaration
public Mat Predict(Mat control = null)
Parameters
Type | Name | Description |
---|---|---|
Mat | control |
Returns
Type | Description |
---|---|
Mat |