cv::KalmanFilter Class Reference
视频分析 » 对象跟踪

Kalman filter class. 更多...

#include <opencv2/video/tracking.hpp>

Public Member Functions

KalmanFilter ()
KalmanFilter (int dynamParams, int measureParams, int controlParams=0, int type= CV_32F )
const Mat & correct (const Mat &measurement)
Updates the predicted state from the measurement. 更多...
void init (int dynamParams, int measureParams, int controlParams=0, int type= CV_32F )
Re-initializes Kalman filter. The previous content is destroyed. 更多...
const Mat & predict (const Mat &control= Mat ())
Computes a predicted state. 更多...

Public Attributes

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

详细描述

Kalman filter class.

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

注意
In C API when CvKalman* kalmanFilter structure is not needed anymore, it should be released with cvReleaseKalman(&kalmanFilter)
范例:
samples/cpp/kalman.cpp .

Constructor & Destructor Documentation

KalmanFilter() [1/2]

cv::KalmanFilter::KalmanFilter ( )
Python:
<KalmanFilter object> = cv.KalmanFilter( )
<KalmanFilter object> = cv.KalmanFilter( dynamParams, measureParams[, controlParams[, type]] )

KalmanFilter() [2/2]

cv::KalmanFilter::KalmanFilter ( int dynamParams ,
int measureParams ,
int controlParams = 0 ,
int type = CV_32F
)
Python:
<KalmanFilter object> = cv.KalmanFilter( )
<KalmanFilter object> = cv.KalmanFilter( dynamParams, measureParams[, controlParams[, type]] )

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

参数
dynamParams Dimensionality of the state.
measureParams Dimensionality of the measurement.
controlParams Dimensionality of the control vector.
type Type of the created matrices that should be CV_32F or CV_64F.

成员函数文档编制

correct()

const Mat & cv::KalmanFilter::correct ( const Mat & measurement )
Python:
retval = cv.KalmanFilter.correct( measurement )

Updates the predicted state from the measurement.

参数
measurement The measured system parameters
范例:
samples/cpp/kalman.cpp .

init()

void cv::KalmanFilter::init ( int dynamParams ,
int measureParams ,
int controlParams = 0 ,
int type = CV_32F
)

Re-initializes Kalman filter. The previous content is destroyed.

参数
dynamParams Dimensionality of the state.
measureParams Dimensionality of the measurement.
controlParams Dimensionality of the control vector.
type Type of the created matrices that should be CV_32F or CV_64F.

predict()

const Mat & cv::KalmanFilter::predict ( const Mat & control = Mat () )
Python:
retval = cv.KalmanFilter.predict( [, control] )

Computes a predicted state.

参数
control The optional input control
范例:
samples/cpp/kalman.cpp .

Member Data Documentation

controlMatrix

Mat cv::KalmanFilter::controlMatrix

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

errorCovPost

Mat cv::KalmanFilter::errorCovPost

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

范例:
samples/cpp/kalman.cpp .

errorCovPre

Mat cv::KalmanFilter::errorCovPre

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

gain

Mat cv::KalmanFilter::gain

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

measurementMatrix

Mat cv::KalmanFilter::measurementMatrix

measurement matrix (H)

范例:
samples/cpp/kalman.cpp .

measurementNoiseCov

Mat cv::KalmanFilter::measurementNoiseCov

measurement noise covariance matrix (R)

范例:
samples/cpp/kalman.cpp .

processNoiseCov

Mat cv::KalmanFilter::processNoiseCov

process noise covariance matrix (Q)

范例:
samples/cpp/kalman.cpp .

statePost

Mat cv::KalmanFilter::statePost

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

范例:
samples/cpp/kalman.cpp .

statePre

Mat cv::KalmanFilter::statePre

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

temp1

Mat cv::KalmanFilter::temp1

temp2

Mat cv::KalmanFilter::temp2

temp3

Mat cv::KalmanFilter::temp3

temp4

Mat cv::KalmanFilter::temp4

temp5

Mat cv::KalmanFilter::temp5

transitionMatrix

Mat cv::KalmanFilter::transitionMatrix

state transition matrix (A)

范例:
samples/cpp/kalman.cpp .

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