fix: 修复feature match sence内无特征点时的死循环问题

c8516a7264
This commit is contained in:
status102
2025-06-03 20:11:43 +08:00
parent d20b539f06
commit 2c8efbbcb9

View File

@@ -190,6 +190,11 @@ asst::FeatureMatcher::ResultsVec asst::FeatureMatcher::feature_postproc(
cv::Rect box = scene_box & make_rect<cv::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<asst::Rect>(box), .count = static_cast<int>(count) });
// remove inside points