diff --git a/src/MeoAssistant/MatchImageAnalyzer.cpp b/src/MeoAssistant/MatchImageAnalyzer.cpp index daea614fe3..58655a071d 100644 --- a/src/MeoAssistant/MatchImageAnalyzer.cpp +++ b/src/MeoAssistant/MatchImageAnalyzer.cpp @@ -108,7 +108,7 @@ bool asst::MatchImageAnalyzer::match_templ(const cv::Mat templ) Log.trace("match_templ |", m_templ_name, "score:", max_val, "rect:", rect.to_string(), "roi:", m_roi.to_string()); } - if (max_val >= m_templ_thres) { + if (m_templ_thres <= max_val && max_val < 2.0) { m_result = { max_val, rect }; return true; } diff --git a/src/MeoAssistant/MultiMatchImageAnalyzer.cpp b/src/MeoAssistant/MultiMatchImageAnalyzer.cpp index 9b2ba6dcb5..859e6a92a3 100644 --- a/src/MeoAssistant/MultiMatchImageAnalyzer.cpp +++ b/src/MeoAssistant/MultiMatchImageAnalyzer.cpp @@ -105,7 +105,7 @@ bool asst::MultiMatchImageAnalyzer::multi_match_templ(const cv::Mat templ) for (int i = 0; i != matched.rows; ++i) { for (int j = 0; j != matched.cols; ++j) { auto value = matched.at(i, j); - if (value >= m_templ_thres) { + if (m_templ_thres <= value && value < 2.0) { Rect rect(j + m_roi.x, i + m_roi.y, templ.cols, templ.rows); bool need_push = true; // 如果有两个点离得太近,只取里面得分高的那个 diff --git a/src/MeoAssistant/OcrPack.cpp b/src/MeoAssistant/OcrPack.cpp index 5a31b7eab4..a4bdd73d7a 100644 --- a/src/MeoAssistant/OcrPack.cpp +++ b/src/MeoAssistant/OcrPack.cpp @@ -97,6 +97,9 @@ std::vector asst::OcrPack::recognize(const cv::Mat image, const } std::string text(*(m_strs_buffer + i)); float score = *(m_scores_buffer + i); + if (score > 2.0) { + score = 0; + } TextRect tr{ score, rect, text }; #ifdef ASST_DEBUG