26 lines
596 B
C++
26 lines
596 B
C++
#ifndef KALMANFILTER_H
|
|
#define KALMANFILTER_H
|
|
|
|
#include <opencv2/opencv.hpp>
|
|
|
|
class KalmanFilter {
|
|
public:
|
|
KalmanFilter();
|
|
|
|
void update(const cv::Point2f& measurement);
|
|
cv::Point2f predict();
|
|
|
|
cv::Point2f get_last_measurement() const { return last_measurement; }
|
|
cv::Point2f get_last_prediction() const { return last_prediction; }
|
|
bool is_initialized() const { return initialized; }
|
|
|
|
private:
|
|
cv::KalmanFilter kf;
|
|
bool initialized;
|
|
cv::Point2f last_measurement;
|
|
cv::Point2f last_prediction;
|
|
|
|
void init_params();
|
|
};
|
|
|
|
#endif // KALMANFILTER_H
|