项目结构大变

This commit is contained in:
2025-11-20 19:29:00 +08:00
parent 6a7ab65597
commit a8791ab3df
17 changed files with 549 additions and 287 deletions

View File

@@ -6,12 +6,16 @@
class KalmanFilter {
public:
KalmanFilter();
void update(const cv::Point2f& measurement);
cv::Point2f predict();
// Method to update the process noise based on target movement characteristics
void updateProcessNoise(const cv::Point2f& current_measurement);
cv::Point2f get_last_measurement() const { return last_measurement; }
cv::Point2f get_last_prediction() const { return last_prediction; }
cv::Point2f get_current_velocity() const; // New method to get current velocity
bool is_initialized() const { return initialized; }
private:
@@ -19,8 +23,16 @@ private:
bool initialized;
cv::Point2f last_measurement;
cv::Point2f last_prediction;
cv::Point2f prev_measurement;
bool has_prev_measurement;
// Store previous states for velocity and acceleration estimation
cv::Point2f prev_velocity;
double time_elapsed; // Time in seconds between measurements
bool has_prev_velocity;
void init_params();
cv::Point2f estimate_velocity(const cv::Point2f& current, const cv::Point2f& previous);
};
#endif // KALMANFILTER_H