项目结构大变

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,21 +6,22 @@
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,
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);
};