mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 18:01:26 +08:00
feat: 支持多模板匹配,任一达到阈值即视为命中
MultiMatcher 暂不支持,仅使用第一个模板
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user