封装了识别干员的TASK

This commit is contained in:
MistEO
2021-08-21 01:25:04 +08:00
parent 99f0f5d996
commit 1c3d8e0878
14 changed files with 331 additions and 18 deletions

View File

@@ -0,0 +1,35 @@
#pragma once
#include "OcrAbstractTask.h"
namespace asst {
// 识别干员任务,会将识别到的信息写入文件中
class IdentifyOperTask : public OcrAbstractTask
{
public:
IdentifyOperTask(AsstCallback callback, void* callback_arg);
virtual ~IdentifyOperTask() = default;
virtual bool run() override;
virtual void set_swipe_param(Rect begin, Rect end, int duration) {
m_swipe_begin = std::move(begin);
m_swipe_end = std::move(end);
m_swipe_duration = duration;
}
void set_filename(const std::string& filename) {
m_filename = filename;
}
protected:
constexpr static int SwipeExtraDelay = 100;
virtual bool swipe(bool reverse = false);
std::vector<TextArea> detect_opers(const cv::Mat& image,
std::unordered_map<std::string, std::string>& feature_cond,
std::unordered_set<std::string>& feature_whatever);
Rect m_swipe_begin;
Rect m_swipe_end;
int m_swipe_duration = 0;
std::string m_filename;
};
}