mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 02:10:21 +08:00
chore: breaking rename
This commit is contained in:
39
src/MaaCore/Task/Interface/DebugTask.cpp
Normal file
39
src/MaaCore/Task/Interface/DebugTask.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "DebugTask.h"
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include "Utils/NoWarningCV.h"
|
||||
|
||||
// #include "Plugin/RoguelikeSkillSelectionTaskPlugin.h"
|
||||
|
||||
#include "Vision/Miscellaneous/DepotImageAnalyzer.h"
|
||||
#include "Vision/Roguelike/StageDropsImageAnalyzer.h"
|
||||
#include "Utils/ImageIo.hpp"
|
||||
#include "Utils/Logger.hpp"
|
||||
|
||||
asst::DebugTask::DebugTask(const AsstCallback& callback, Assistant* inst)
|
||||
: InterfaceTask(callback, inst, TaskType)
|
||||
{
|
||||
////auto task_ptr = std::make_shared<RoguelikeSkillSelectionTaskPlugin>(callback, inst, TaskType);
|
||||
// auto task_ptr = std::make_shared<StageDropsTaskPlugin>(callback, inst, TaskType);
|
||||
// m_subtasks.emplace_back(task_ptr);
|
||||
}
|
||||
|
||||
bool asst::DebugTask::run()
|
||||
{
|
||||
size_t total = 0;
|
||||
size_t success = 0;
|
||||
for (const auto& entry : std::filesystem::directory_iterator("../../test/drops/screenshots/ja_jp")) {
|
||||
cv::Mat image = asst::imread(entry.path());
|
||||
if (image.empty()) {
|
||||
continue;
|
||||
}
|
||||
total += 1;
|
||||
cv::Mat resized;
|
||||
cv::resize(image, resized, cv::Size(1280, 720), 0, 0, cv::INTER_AREA);
|
||||
StageDropsImageAnalyzer analyzer(resized);
|
||||
success += analyzer.analyze();
|
||||
}
|
||||
Log.info(__FUNCTION__, success, "/", total);
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user