![]() |
AutoCar
v1.0.0
|
Public Member Functions | |
armor_detecter (bool debug_on) | |
constructor | |
cv::Mat | highlight_blue_or_red (const cv::Mat &image, bool detect_blue) |
Highlight the blue or red region of the image. More... | |
std::vector< std::vector< cv::Point > > | find_contours (const cv::Mat &binary) |
The wrapper for function cv::findContours. More... | |
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) |
Finding the true light contour. More... | |
std::vector< cv::RotatedRect > | detect_lights (bool detect_blue) |
detect the lights on the armors More... | |
std::vector< cv::RotatedRect > | filter_lights (const std::vector< cv::RotatedRect > &lights, float thresh_max_angle, float thresh_min_area) |
Filtering the detected lights. More... | |
std::vector< armor_info > | possible_armors (const std::vector< cv::RotatedRect > &lights, float thres_max_angle, float thres_dis_lower, float thres_dis_upper, float thres_len, float thres_height, float thres_gray, bool detect_blue) |
The possible armors. More... | |
void | cal_armor_info (std::vector< cv::Point2f > &armor_points, cv::RotatedRect left_light, cv::RotatedRect right_light) |
std::vector< armor_info > | filter_by_features (std::vector< armor_info > &armors) |
Filtering Detected armors by aspect ratio, conv and so on. More... | |
bool | detect (const cv::Mat &image, bool detect_blue) |
The entrance function of armor detect. More... | |
void | slect_final_armor (std::vector< armor_info > all_armors) |
Slect one armor as the target armor which we will shoot. More... | |
armor_info * | get_armor () |
Get the private armor information. More... | |
void | debug_vision () |
Show the processed image for debug. | |
|
virtual |
The entrance function of armor detect.
image | rgb image |
Implements autocar::vision_mul::detect_factory.
std::vector<cv::RotatedRect> autocar::vision_mul::armor_detecter::detect_lights | ( | bool | detect_blue | ) |
detect the lights on the armors
detect_blue | true represent blue, false represent red |
std::vector<armor_info> autocar::vision_mul::armor_detecter::filter_by_features | ( | std::vector< armor_info > & | armors | ) |
Filtering Detected armors by aspect ratio, conv and so on.
armors | detected armors ref |
std::vector<cv::RotatedRect> autocar::vision_mul::armor_detecter::filter_lights | ( | const std::vector< cv::RotatedRect > & | lights, |
float | thresh_max_angle, | ||
float | thresh_min_area | ||
) |
Filtering the detected lights.
lights | detected lights ref |
thresh_max_angle | the max area of the lights |
thresh_min_area | the min area of the lights |
std::vector<std::vector<cv::Point> > autocar::vision_mul::armor_detecter::find_contours | ( | const cv::Mat & | binary | ) |
The wrapper for function cv::findContours.
binary | binary image |
armor_info* autocar::vision_mul::armor_detecter::get_armor | ( | ) |
Get the private armor information.
cv::Mat autocar::vision_mul::armor_detecter::highlight_blue_or_red | ( | const cv::Mat & | image, |
bool | detect_blue | ||
) |
Highlight the blue or red region of the image.
image | input image ref |
detect_blue | true represent blue, false represent red |
std::vector<armor_info> autocar::vision_mul::armor_detecter::possible_armors | ( | const std::vector< cv::RotatedRect > & | lights, |
float | thres_max_angle, | ||
float | thres_dis_lower, | ||
float | thres_dis_upper, | ||
float | thres_len, | ||
float | thres_height, | ||
float | thres_gray, | ||
bool | detect_blue | ||
) |
The possible armors.
detected | lights beside the armors |
thres_max_angle | the max angle of the armor |
thres_dis_lower | |
thres_dis_upper | |
thres_len | |
thres_height | |
thres_gray | |
detect_blue |
void autocar::vision_mul::armor_detecter::slect_final_armor | ( | std::vector< armor_info > | all_armors | ) |
Slect one armor as the target armor which we will shoot.
all_armors | all detected armors |
std::vector<cv::RotatedRect> autocar::vision_mul::armor_detecter::to_light_rects | ( | const std::vector< std::vector< cv::Point >> & | contours_light, |
const std::vector< std::vector< cv::Point >> & | contours_brightness | ||
) |
Finding the true light contour.
contours_light | blue or red region contour |
contours_brightness | gray image contour |