4 #include <opencv2/opencv.hpp> 9 #include "detect_factory.h" 18 armor_info(
int type_, cv::RotatedRect armor_, std::vector<cv::Point2f> points_, cv::RotatedRect left_=cv::RotatedRect(), cv::RotatedRect right_=cv::RotatedRect())
30 cv::RotatedRect armor;
31 std::vector<cv::Point2f> points;
32 cv::RotatedRect left_light;
33 cv::RotatedRect right_light;
41 const static float m_threshold_max_angle;
42 const static float m_threshold_min_area;
43 const static float m_threshold_dis_lower;
44 const static float m_threshold_dis_upper;
45 const static float m_threshold_len;
46 const static float m_threshold_height;
47 const static float m_threshold_gray;
61 cv::Mat highlight_blue_or_red(
const cv::Mat &image,
bool detect_blue);
67 std::vector<std::vector<cv::Point>> find_contours(
const cv::Mat &binary);
74 std::vector<cv::RotatedRect> to_light_rects(
const std::vector<std::vector<cv::Point>> &contours_light,
const std::vector<std::vector<cv::Point>> &contours_brightness);
80 std::vector<cv::RotatedRect> detect_lights(
bool detect_blue);
88 std::vector<cv::RotatedRect> filter_lights(
const std::vector<cv::RotatedRect> &lights,
float thresh_max_angle,
float thresh_min_area);
101 std::vector<armor_info> possible_armors(
const std::vector<cv::RotatedRect> &lights,
float thres_max_angle,
float thres_dis_lower, \
102 float thres_dis_upper,
float thres_len,
float thres_height,
float thres_gray,
bool detect_blue);
103 void cal_armor_info(std::vector<cv::Point2f> &armor_points, cv::RotatedRect left_light, cv::RotatedRect right_light);
109 std::vector<armor_info> filter_by_features(std::vector<armor_info> &armors);
115 bool detect(
const cv::Mat &image,
bool detect_blue);
121 void slect_final_armor(std::vector<armor_info> all_armors);
138 cv::Mat possible_armor;
140 cv::Mat m_binary_brightness;
141 cv::Mat m_binary_color;
142 cv::Mat m_binary_light;
145 std::chrono::system_clock::time_point speed_test_start_begin_time;
153 #endif // !__ARMOR_H__ Definition: armor_detect.h:15
Definition: armor_detect.h:37
Definition: detect_factory.h:8