admin
2025-04-08 5c9991be21f57781573f04961ec511ac2938ea3d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#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);
 
};