#pragma once
|
#include <opencv2/opencv.hpp>
|
#include <opencv2/highgui.hpp>
|
#include <opencv2/core.hpp>
|
#include <opencv2/imgcodecs.hpp>
|
#include <tesseract/baseapi.h>
|
#include <leptonica/allheaders.h>
|
#include "Win32Util.h"
|
class WechatOCR
|
{
|
|
private:
|
tesseract::TessBaseAPI* tessApi;
|
private:
|
static HWND getWechatWindow();
|
|
static cv::Mat capture(HWND hwnd);
|
|
string ocrCode(cv::Mat src);
|
public:
|
WechatOCR();
|
~WechatOCR();
|
|
void ocr(cv::Mat src);
|
|
|
void test(Pix* src);
|
|
|
static list<HWND> getWechatSimulatorHwnds();
|
|
static cv::Mat grayImage(cv::Mat src);
|
|
};
|