#pragma once
|
//ͬ»¨Ë³¶ÌÏß¾«Áé
|
#include "OpenCLExcuter.h"
|
struct DXJLOCRContent {
|
string time;
|
//´úÂëÃû³Æ×ø±ê
|
cv::Rect codeNamePos;
|
//´úÂëλÖõÄMD5Öµ
|
string codeNameMD5;
|
//ʼþÃû³ÆÎ»ÖÃ
|
cv::Rect eventNamePos;
|
//ʼþ²ÎÊýλÖÃ
|
cv::Rect eventParamsPos;
|
};
|
|
struct DXJLEvent {
|
string time;
|
string code;
|
string eventName;
|
string eventParams;
|
};
|
struct DXJLResult
|
{
|
list<DXJLOCRContent> contentList;
|
cv::Mat grayImg;
|
};
|
|
typedef string (*CallbackFun_DXJL_OCR)(cv::Mat& grayImg);
|
|
|
class THSDXJLCapture
|
{
|
private:
|
static OpenCLExcuter* openCLExcuter;
|
//ÊÇ·ñÔÚ½»Ò×ʱ¼ä²Å½ØÍ¼
|
static bool tradeTimeCapture;
|
bool inited;
|
//ÊÇ·ñÕýÔÚÖ´ÐÐ
|
static bool running;
|
|
static void* context;
|
|
static CallbackFun_DXJL_OCR ocr_fun;
|
|
static void _run();
|
|
static std::list<int*> splitRows(cv::Mat grayImg, int contentStartRow, std::list<int*> dataColIndexs);
|
|
static std::list<int*> split(cv::Mat grayImg);
|
|
static string md5Mat(cv::Mat grayImg);
|
|
|
|
public:
|
void init(CallbackFun_DXJL_OCR matOcrFun);
|
|
bool is_inited();
|
|
void start();
|
|
void stop();
|
|
bool is_running();
|
|
|
static DXJLResult capture();
|
|
static DXJLResult capture(HWND hwnd);
|
|
static DXJLResult capture(cv::Mat img,OpenCLExcuter * openCLExcuter);
|
|
static std::list<DXJLOCRContent> captureGray(cv::Mat grayImg, OpenCLExcuter* openCLExcuter);
|
|
};
|