From 2c8efbbcb9fe9dd9880a98544ef9b635c8a66874 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Tue, 3 Jun 2025 20:11:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dfeature=20match=20senc?= =?UTF-8?q?e=E5=86=85=E6=97=A0=E7=89=B9=E5=BE=81=E7=82=B9=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E6=AD=BB=E5=BE=AA=E7=8E=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/MaaXYZ/MaaFramework/commit/c8516a7264e5d304a51004dd7d1854481144dc4f --- src/MaaCore/Vision/FeatureMatcher.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/MaaCore/Vision/FeatureMatcher.cpp b/src/MaaCore/Vision/FeatureMatcher.cpp index a49adf2a3f..751c1f9a7b 100644 --- a/src/MaaCore/Vision/FeatureMatcher.cpp +++ b/src/MaaCore/Vision/FeatureMatcher.cpp @@ -190,6 +190,11 @@ asst::FeatureMatcher::ResultsVec asst::FeatureMatcher::feature_postproc( cv::Rect box = scene_box & make_rect(m_roi); size_t count = std::ranges::count_if(scene, [&box](const auto& point) { return box.contains(point); }); + if (count == 0) { + LogTrace << "No points in box" << VAR(box) << VAR(scene_box) << VAR(m_roi); + break; + } + results.emplace_back(Result { .rect = make_rect(box), .count = static_cast(count) }); // remove inside points