perf.信用商店购物热流程化

This commit is contained in:
MistEO
2021-10-15 00:03:21 +08:00
parent 29e4d099ac
commit c487bbd506
5 changed files with 70 additions and 48 deletions

View File

@@ -23,6 +23,21 @@ bool asst::MultiMatchImageAnalyzer::analyze()
return multi_match_templ(templ);
}
void asst::MultiMatchImageAnalyzer::sort_result()
{
// 按位置排个序
std::sort(m_result.begin(), m_result.end(),
[](const MatchRect& lhs, const MatchRect& rhs) -> bool {
if (std::abs(lhs.rect.y - rhs.rect.y) < 5) { // y差距较小则理解为是同一排的按x排序
return lhs.rect.x < rhs.rect.x;
}
else {
return lhs.rect.y < rhs.rect.y;
}
}
);
}
bool asst::MultiMatchImageAnalyzer::multi_match_templ(const cv::Mat& templ)
{
cv::Mat matched;