Class KalmanFilter
Represents a Kalman filter state.
Namespace: OpenCV.Net
Assembly: OpenCV.Net.dll
Syntax
public class KalmanFilter : CVHandle
Constructors
| Improve this Doc View SourceKalmanFilter(Int32, Int32, Int32)
Initializes a new instance of the KalmanFilter class with the specified dimensionality.
Declaration
public KalmanFilter(int dynamParams, int measureParams, int controlParams)
Parameters
Type | Name | Description |
---|---|---|
Int32 | dynamParams | Dimensionality of the state vector. |
Int32 | measureParams | Dimensionality of the measurement vector. |
Int32 | controlParams | Dimensionality of the control vector. |
Properties
| Improve this Doc View SourceControlMatrix
Gets the control matrix (B). Not used if there is no control.
Declaration
public Mat ControlMatrix { get; }
Property Value
Type | Description |
---|---|
Mat |
ErrorCovariancePosterior
Gets the posterior error estimate covariance matrix (P(k)): P(k) = (I - K(k) * H) * P'(k).
Declaration
public Mat ErrorCovariancePosterior { get; }
Property Value
Type | Description |
---|---|
Mat |
ErrorCovariancePrior
Gets the prior error estimate covariance matrix (P'(k)): P'(k) = A * P(k - 1) * At + Q.
Declaration
public Mat ErrorCovariancePrior { get; }
Property Value
Type | Description |
---|---|
Mat |
Gain
Gets the Kalman gain matrix (K(k)): K(k) = P'(k) * Ht * inv(H * P'(k) * Ht + R).
Declaration
public Mat Gain { get; }
Property Value
Type | Description |
---|---|
Mat |
MeasurementMatrix
Gets the measurement matrix (H).
Declaration
public Mat MeasurementMatrix { get; }
Property Value
Type | Description |
---|---|
Mat |
MeasurementNoiseCovariance
Gets the measurement noise covariance matrix (R).
Declaration
public Mat MeasurementNoiseCovariance { get; }
Property Value
Type | Description |
---|---|
Mat |
ProcessNoiseCovariance
Gets the process noise covariance matrix (Q).
Declaration
public Mat ProcessNoiseCovariance { get; }
Property Value
Type | Description |
---|---|
Mat |
StateCorrected
Gets the corrected state vector (x(k)): x(k) = x'(k) + K(k) * (z(k) - H * x'(k))
Declaration
public Mat StateCorrected { get; }
Property Value
Type | Description |
---|---|
Mat |
StatePredicted
Gets the predicted state vector (x'(k)): x'(k) = A * x(k - 1) + B * u(k).
Declaration
public Mat StatePredicted { get; }
Property Value
Type | Description |
---|---|
Mat |
TransitionMatrix
Gets the state transition matrix (A).
Declaration
public Mat TransitionMatrix { get; }
Property Value
Type | Description |
---|---|
Mat |
Methods
| Improve this Doc View SourceCorrect(Mat)
Adjusts the model state.
Declaration
public Mat Correct(Mat measurement)
Parameters
Type | Name | Description |
---|---|---|
Mat | measurement | The measurement vector z(k). |
Returns
Type | Description |
---|---|
Mat | The adjusted state estimate. |
Predict()
Estimates the subsequent model state.
Declaration
public Mat Predict()
Returns
Type | Description |
---|---|
Mat | The estimated state vector. |
Predict(Mat)
Estimates the subsequent model state.
Declaration
public Mat Predict(Mat control)
Parameters
Type | Name | Description |
---|---|---|
Mat | control | The control vector u(k) or null if there is no control. |
Returns
Type | Description |
---|---|
Mat | The estimated state vector. |
ReleaseHandle()
Executes the code required to free the native KalmanFilter handle.
Declaration
protected override bool ReleaseHandle()
Returns
Type | Description |
---|---|
Boolean | true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. |