From 5d9821d979343ba3945bea53c214cdac13e64495 Mon Sep 17 00:00:00 2001 From: zzyyyl Date: Wed, 20 Jul 2022 18:15:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?perf:=20=E6=B3=A8=E9=87=8A=E6=8E=89?= =?UTF-8?q?=E4=B8=80=E8=A1=8C=E6=B2=A1=E7=94=A8=E5=88=B0=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E4=BF=AE=E6=AD=A3=E9=94=99=E5=88=AB=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAssistant/BattleImageAnalyzer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MeoAssistant/BattleImageAnalyzer.cpp b/src/MeoAssistant/BattleImageAnalyzer.cpp index ff2e3a27a8..d594bdb795 100644 --- a/src/MeoAssistant/BattleImageAnalyzer.cpp +++ b/src/MeoAssistant/BattleImageAnalyzer.cpp @@ -154,9 +154,9 @@ bool asst::BattleImageAnalyzer::opers_analyze() Rect role_rect = flag_mrect.rect.move(role_move); oper.role = oper_role_analyze(role_rect); - Rect cost_rect = flag_mrect.rect.move(cost_move); // 费用识别的不太准,暂时也没用上,先注释掉,TODO:优化费用识别 + //Rect cost_rect = flag_mrect.rect.move(cost_move); //oper.cost = oper_cost_analyze(cost_rect); oper.index = index++; @@ -190,10 +190,10 @@ asst::BattleRole asst::BattleImageAnalyzer::oper_role_analyze(const Rect& roi) if (!role_analyzer.analyze()) { continue; } - if (double cur_socre = role_analyzer.get_result().score; - max_score < cur_socre) { + if (double cur_score = role_analyzer.get_result().score; + max_score < cur_score) { result = role; - max_score = cur_socre; + max_score = cur_score; } } From 31b2e54fea9641910ce54357c37bf7ad755081cd Mon Sep 17 00:00:00 2001 From: Horror Proton <107091537+horror-proton@users.noreply.github.com> Date: Wed, 20 Jul 2022 18:40:33 +0800 Subject: [PATCH 2/3] fix: remove a C++20 constexpr --- src/MeoAssistant/TaskData.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MeoAssistant/TaskData.h b/src/MeoAssistant/TaskData.h index 32adeff585..c4c4563fa3 100644 --- a/src/MeoAssistant/TaskData.h +++ b/src/MeoAssistant/TaskData.h @@ -26,7 +26,7 @@ namespace asst const std::unordered_set& get_templ_required() const noexcept; template - constexpr std::shared_ptr get(const std::string& name) + std::shared_ptr get(const std::string& name) { auto it = m_all_tasks_info.find(name); if (it == m_all_tasks_info.cend()) { From 012570916ce9b9922a38e779fcce81ed61a75dc5 Mon Sep 17 00:00:00 2001 From: MistEO Date: Wed, 20 Jul 2022 21:42:17 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=81=B6=E7=8E=B0?= =?UTF-8?q?=E6=8E=89=E8=90=BD=E8=AF=86=E5=88=AB=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/1245 --- src/MeoAssistant/StageDropsImageAnalyzer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MeoAssistant/StageDropsImageAnalyzer.cpp b/src/MeoAssistant/StageDropsImageAnalyzer.cpp index eaacee0cca..55d930f5d7 100644 --- a/src/MeoAssistant/StageDropsImageAnalyzer.cpp +++ b/src/MeoAssistant/StageDropsImageAnalyzer.cpp @@ -264,7 +264,7 @@ bool asst::StageDropsImageAnalyzer::analyze_baseline() for (int j = 0; j < bounding.rows; ++j) { value = std::max(value, bounding.at(j, i)); } - bool is_white = value > threshold && pre_value - value < threshold; + bool is_white = value > threshold && pre_value - value < 15; pre_value = value; if (in && !is_white) {