5 #include "opencv2/opencv.hpp" 17 kalman =
new cv::KalmanFilter(6, 3, 0);
19 kalman->transitionMatrix = (cv::Mat_<track_t>(6, 6) <<
41 kalman->measurementMatrix = (cv::Mat_<track_t>(3, 6) <<
47 float c1 = pow(
dt,4.0)/4.0;
48 float c2 = pow(
dt,2.0);
49 float c3 = pow(
dt,3.0)/2.0;
50 kalman->processNoiseCov = sigma*sigma*(cv::Mat_<float>(6, 6) <<
58 cv::setIdentity(
kalman->measurementNoiseCov, cv::Scalar::all(5e-2));
60 cv::setIdentity(
kalman->errorCovPost, cv::Scalar::all(1000000));
68 cv::Mat prediction =
kalman->predict();
76 cv::Mat measurement(3, 1,
Mat_t(1));
85 measurement.at<
track_t>(0) = p.x;
86 measurement.at<
track_t>(1) = p.y;
87 measurement.at<
track_t>(2) = p.z;
90 cv::Mat estimated =
kalman->correct(measurement);
Point_t Update(Point_t p, bool DataCorrect)
cv::Point3_< track_t > Point_t
cv::KalmanFilter * kalman
TKalmanFilter(Point_t p, track_t deltatime=0.2)