#ifndef BALLISTICPREDICTOR_H #define BALLISTICPREDICTOR_H #include class BallisticPredictor { public: BallisticPredictor(float bullet_speed = 16.0f); ~BallisticPredictor(); // Added destructor to properly manage memory // Predict ballistic point considering target movement and flight time cv::Point2f* predict_ballistic_point(const cv::Point2f* predicted_center, const cv::Point2f& img_center, const cv::Point2f& target_speed); // Get last ballistic point const cv::Point2f* get_last_ballistic_point() const { return last_ballistic_point; } private: float bullet_speed; // Bullet speed (m/s) float armor_half_width; // Armor half width (converted to meters) float armor_half_height; // Armor half height (converted to meters) cv::Point2f* last_ballistic_point; // Last ballistic prediction // Calculate distance to target float calculate_distance(const cv::Point2f& armor_center, const cv::Point2f& img_center, float focal_length = 800.0f); }; #endif // BALLISTICPREDICTOR_H