内容填充

This commit is contained in:
2025-11-19 20:21:45 +08:00
parent a52d1118c9
commit ad5ced1cff
58 changed files with 15670 additions and 2 deletions

28
BallisticPredictor.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef BALLISTICPREDICTOR_H
#define BALLISTICPREDICTOR_H
#include <opencv2/opencv.hpp>
class BallisticPredictor {
public:
BallisticPredictor(float bullet_speed = 16.0f);
// 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