OpenCV  3.2.0-dev
Open Source Computer Vision
cv::KalmanFilter Class Reference

Kalman filter class. More...

#include "tracking.hpp"

Collaboration diagram for cv::KalmanFilter:

Public Member Functions

 KalmanFilter ()
 The constructors. More...
 
 KalmanFilter (int dynamParams, int measureParams, int controlParams=0, int type=CV_32F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
const Matcorrect (const Mat &measurement)
 Updates the predicted state from the measurement. More...
 
void init (int dynamParams, int measureParams, int controlParams=0, int type=CV_32F)
 Re-initializes Kalman filter. More...
 
const Matpredict (const Mat &control=Mat())
 Computes a predicted state. More...
 

Public Attributes

Mat controlMatrix
 control matrix (B) (not used if there is no control) More...
 
Mat errorCovPost
 posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k) More...
 
Mat errorCovPre
 priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)*/ More...
 
Mat gain
 Kalman gain matrix (K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R) More...
 
Mat measurementMatrix
 measurement matrix (H) More...
 
Mat measurementNoiseCov
 measurement noise covariance matrix (R) More...
 
Mat processNoiseCov
 process noise covariance matrix (Q) More...
 
Mat statePost
 corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k)) More...
 
Mat statePre
 predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k) More...
 
Mat temp1
 
Mat temp2
 
Mat temp3
 
Mat temp4
 
Mat temp5
 
Mat transitionMatrix
 state transition matrix (A) More...
 

Detailed Description

Kalman filter class.

The class implements a standard Kalman filter http://en.wikipedia.org/wiki/Kalman_filter, [90] . However, you can modify transitionMatrix, controlMatrix, and measurementMatrix to get an extended Kalman filter functionality. See the OpenCV sample kalman.cpp.

Note
  • An example using the standard Kalman filter can be found at opencv_source_code/samples/cpp/kalman.cpp

Constructor & Destructor Documentation

cv::KalmanFilter::KalmanFilter ( )

The constructors.

Note
In C API when CvKalman* kalmanFilter structure is not needed anymore, it should be released with cvReleaseKalman(&kalmanFilter)
cv::KalmanFilter::KalmanFilter ( int  dynamParams,
int  measureParams,
int  controlParams = 0,
int  type = CV_32F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
dynamParamsDimensionality of the state.
measureParamsDimensionality of the measurement.
controlParamsDimensionality of the control vector.
typeType of the created matrices that should be CV_32F or CV_64F.

Member Function Documentation

const Mat& cv::KalmanFilter::correct ( const Mat measurement)

Updates the predicted state from the measurement.

Parameters
measurementThe measured system parameters
void cv::KalmanFilter::init ( int  dynamParams,
int  measureParams,
int  controlParams = 0,
int  type = CV_32F 
)

Re-initializes Kalman filter.

The previous content is destroyed.

Parameters
dynamParamsDimensionality of the state.
measureParamsDimensionality of the measurement.
controlParamsDimensionality of the control vector.
typeType of the created matrices that should be CV_32F or CV_64F.
const Mat& cv::KalmanFilter::predict ( const Mat control = Mat())

Computes a predicted state.

Parameters
controlThe optional input control

Member Data Documentation

Mat cv::KalmanFilter::controlMatrix

control matrix (B) (not used if there is no control)

Mat cv::KalmanFilter::errorCovPost

posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k)

Mat cv::KalmanFilter::errorCovPre

priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)*/

Mat cv::KalmanFilter::gain

Kalman gain matrix (K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)

Mat cv::KalmanFilter::measurementMatrix

measurement matrix (H)

Mat cv::KalmanFilter::measurementNoiseCov

measurement noise covariance matrix (R)

Mat cv::KalmanFilter::processNoiseCov

process noise covariance matrix (Q)

Mat cv::KalmanFilter::statePost

corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k))

Mat cv::KalmanFilter::statePre

predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k)

Mat cv::KalmanFilter::temp1
Mat cv::KalmanFilter::temp2
Mat cv::KalmanFilter::temp3
Mat cv::KalmanFilter::temp4
Mat cv::KalmanFilter::temp5
Mat cv::KalmanFilter::transitionMatrix

state transition matrix (A)


The documentation for this class was generated from the following file: