perf: 优化自动战斗部署栏识别条件,保全增加节能模式 (#8044)

* perf: 优化保全部署栏识别条件,增加节能模式

* fix: equal error

* chore: 跳过update改为sleep

* perf: 优化保全逻辑

* chore: 仅在开局识别干员部署费用
This commit is contained in:
uye
2024-01-21 15:30:37 +08:00
committed by GitHub
parent e6db0fb314
commit bdf43752c1
5 changed files with 59 additions and 11 deletions

View File

@@ -98,7 +98,14 @@ bool asst::BattleHelper::update_deployment(bool init, const cv::Mat& reusable)
}
BattlefieldMatcher oper_analyzer(image);
oper_analyzer.set_object_of_interest({ .deployment = true });
// 保全要识别开局费用先用init判断了之后别的地方要用的话再做cache
if (init) {
oper_analyzer.set_object_of_interest({ .deployment = true, .oper_cost = true });
}
else {
oper_analyzer.set_object_of_interest({ .deployment = true });
}
auto oper_result_opt = oper_analyzer.analyze();
if (!oper_result_opt) {
check_in_battle(image);