mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 02:10:21 +08:00
refactor: 重构全部战斗相关视觉代码
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "Utils/ImageIo.hpp"
|
||||
#include "Utils/Logger.hpp"
|
||||
#include "Vision/Battle/BattleSkillReadyImageAnalyzer.h"
|
||||
#include "Vision/Battle/BattlefieldClassifier.h"
|
||||
#include "Vision/Battle/BattlefieldMatcher.h"
|
||||
#include "Vision/Miscellaneous/DepotImageAnalyzer.h"
|
||||
#include "Vision/Miscellaneous/StageDropsImageAnalyzer.h"
|
||||
@@ -42,17 +42,19 @@ void asst::DebugTask::test_skill_ready()
|
||||
int correct = 0;
|
||||
for (const auto& entry : std::filesystem::directory_iterator(R"(../../test/skill_ready/y)")) {
|
||||
cv::Mat image = imread(entry.path().string());
|
||||
BattleSkillReadyImageAnalyzer analyzer(image);
|
||||
BattlefieldClassifier analyzer(image);
|
||||
analyzer.set_object_of_interest({ .skill_ready = true });
|
||||
total++;
|
||||
if (analyzer.analyze()) {
|
||||
if (analyzer.analyze()->skill_ready.ready) {
|
||||
correct++;
|
||||
}
|
||||
}
|
||||
for (const auto& entry : std::filesystem::directory_iterator(R"(../../test/skill_ready/n)")) {
|
||||
cv::Mat image = imread(entry.path().string());
|
||||
BattleSkillReadyImageAnalyzer analyzer(image);
|
||||
BattlefieldClassifier analyzer(image);
|
||||
analyzer.set_object_of_interest({ .skill_ready = true });
|
||||
total++;
|
||||
if (!analyzer.analyze()) {
|
||||
if (!analyzer.analyze()->skill_ready.ready) {
|
||||
correct++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user