mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 10:00:44 +08:00
perf.信用商店购物热流程化
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user