feat: 支持多模板匹配,任一达到阈值即视为命中

MultiMatcher 暂不支持,仅使用第一个模板
This commit is contained in:
MistEO
2023-10-01 13:54:56 +08:00
parent cba20939a8
commit 42762bfbb7
13 changed files with 160 additions and 105 deletions

View File

@@ -132,14 +132,16 @@ bool asst::BattleHelper::update_deployment(bool init, const cv::Mat& reusable)
BestMatcher avatar_analyzer(oper.avatar);
if (oper.cooling) {
Log.trace("start matching cooling", oper.index);
static const double cooling_threshold = Task.get<MatchTaskInfo>("BattleAvatarCoolingData")->templ_threshold;
static const double cooling_threshold =
Task.get<MatchTaskInfo>("BattleAvatarCoolingData")->templ_thresholds.front();
static const auto cooling_mask_range = Task.get<MatchTaskInfo>("BattleAvatarCoolingData")->mask_range;
avatar_analyzer.set_threshold(cooling_threshold);
avatar_analyzer.set_mask_range(cooling_mask_range.first, cooling_mask_range.second, true, true);
}
else {
static const double threshold = Task.get<MatchTaskInfo>("BattleAvatarData")->templ_threshold;
static const double drone_threshold = Task.get<MatchTaskInfo>("BattleDroneAvatarData")->templ_threshold;
static const double threshold = Task.get<MatchTaskInfo>("BattleAvatarData")->templ_thresholds.front();
static const double drone_threshold =
Task.get<MatchTaskInfo>("BattleDroneAvatarData")->templ_thresholds.front();
avatar_analyzer.set_threshold(oper.role == Role::Drone ? drone_threshold : threshold);
}