diff --git a/modules/tracking/include/opencv2/tracking/kalman_filters.hpp b/modules/tracking/include/opencv2/tracking/kalman_filters.hpp index a1afc1b71..e733b22ba 100644 --- a/modules/tracking/include/opencv2/tracking/kalman_filters.hpp +++ b/modules/tracking/include/opencv2/tracking/kalman_filters.hpp @@ -80,6 +80,11 @@ public: */ virtual Mat getMeasurementNoiseCov() const = 0; + /** + * @return the error cross-covariance matrix. + */ + virtual Mat getErrorCov() const = 0; + /** * @return the current estimate of the state. */ diff --git a/modules/tracking/src/augmented_unscented_kalman.cpp b/modules/tracking/src/augmented_unscented_kalman.cpp index 43b963c43..953e422fc 100644 --- a/modules/tracking/src/augmented_unscented_kalman.cpp +++ b/modules/tracking/src/augmented_unscented_kalman.cpp @@ -195,6 +195,7 @@ public: Mat getProcessNoiseCov() const; Mat getMeasurementNoiseCov() const; + Mat getErrorCov() const; Mat getState() const; @@ -425,6 +426,11 @@ Mat AugmentedUnscentedKalmanFilterImpl::getMeasurementNoiseCov() const return measurementNoiseCov.clone(); } +Mat AugmentedUnscentedKalmanFilterImpl::getErrorCov() const +{ + return errorCov.clone(); +} + Mat AugmentedUnscentedKalmanFilterImpl::getState() const { return state.clone(); diff --git a/modules/tracking/src/unscented_kalman.cpp b/modules/tracking/src/unscented_kalman.cpp index 5955f3bd4..8cfa9d38b 100644 --- a/modules/tracking/src/unscented_kalman.cpp +++ b/modules/tracking/src/unscented_kalman.cpp @@ -189,6 +189,7 @@ public: // Get system parameters Mat getProcessNoiseCov() const; Mat getMeasurementNoiseCov() const; + Mat getErrorCov() const; // Get the state estimate Mat getState() const; @@ -400,6 +401,11 @@ Mat UnscentedKalmanFilterImpl::getMeasurementNoiseCov() const return measurementNoiseCov.clone(); } +Mat UnscentedKalmanFilterImpl::getErrorCov() const +{ + return errorCov.clone(); +} + Mat UnscentedKalmanFilterImpl::getState() const { return state.clone();