fix.修复两个肉鸽闪退的问题

https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/669
This commit is contained in:
MistEO
2022-06-03 01:30:58 +08:00
parent 886ff3af9b
commit 7f1e33bbd8
4 changed files with 29 additions and 3 deletions

View File

@@ -98,8 +98,6 @@ void asst::MatchImageAnalyzer::set_task_info(MatchTaskInfo task_info) noexcept
}
bool asst::MatchImageAnalyzer::match_templ(const cv::Mat templ)
{
cv::Mat matched;
if (m_roi.x < 0) {
Log.info("roi is out of range", m_roi.to_string());
m_roi.x = 0;
@@ -124,6 +122,8 @@ bool asst::MatchImageAnalyzer::match_templ(const cv::Mat templ)
"templ size:", templ.cols, templ.rows);
return false;
}
cv::Mat matched;
if (m_mask_range.first == 0 && m_mask_range.second == 0) {
cv::matchTemplate(image_roi, templ, matched, cv::TM_CCOEFF_NORMED);
}