From dcde93a6080c585624482f4be3e468292f9709ed Mon Sep 17 00:00:00 2001 From: xinyang <895639507@qq.com> Date: Thu, 8 Aug 2019 00:22:39 +0800 Subject: [PATCH] armor small change --- armor/src/armor_finder/find/find_light_blobs.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/armor/src/armor_finder/find/find_light_blobs.cpp b/armor/src/armor_finder/find/find_light_blobs.cpp index f456c77..6842a3a 100644 --- a/armor/src/armor_finder/find/find_light_blobs.cpp +++ b/armor/src/armor_finder/find/find_light_blobs.cpp @@ -130,8 +130,13 @@ bool ArmorFinder::findLightBlobs(const cv::Mat &src, LightBlobs &light_blobs) { color_channel = channels[2]; /************************/ } - - cv::threshold(color_channel, src_bin_light, 200, 255, CV_THRESH_BINARY); // 二值化对应通道 + int light_threshold; + if(enemy_color == ENEMY_BLUE){ + light_threshold = 225; + }else{ + light_threshold = 200; + } + cv::threshold(color_channel, src_bin_light, light_threshold, 255, CV_THRESH_BINARY); // 二值化对应通道 if (src_bin_light.empty()) return false; imagePreProcess(src_bin_light); // 开闭运算