admin
2022-09-09 60feedf43a35a9ca69d05095a01c5d1797b1bdc3
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#pragma once
#include <string>
#include <list>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp> 
#include "CaptureUtil.h"
#include "RecognitionManager.h"
enum ImgType
{
    IMG_TYPE_GP,
    IMG_TYPE_ADD
};
 
enum MoneyUnit {
    MONEY_UNIT_Y,
    MONEY_UNIT_W,
};
struct GPCodeArea
{
    ImgType type;
    int startx;
    int starty;
    int endx;
    int endy;
    std::string code;
 
    //L2Êý¾ÝÓÐЧ
    int cateIndex;
};
//ͬ»¨Ë³Ê¼þ
class THSActionUtil
{
private:
    static void addGP(string code);
    //ÅúÁ¿Ìí¼Ó¹ÉƱ
    static void betchAddGP(HWND addDialog,list<string> codeList);
    
    //ɾ³ý°å¿éÄÚµÄËùÓдúÂë
    static void clearPlateCodes(HWND hwnd);
 
    //»ñÈ¡°å¿éÖдúÂëÌí¼Ó°´Å¥µÄλÖÃ
    static RECT getPlateAddCodeBtnPostion(HWND win);
 
public:
    static HWND getMainWin();
 
    static HWND getL2Win();
 
    static HWND getThirdWindow();
 
    static HWND getSecondWindow();
    //ÐÐÒµ
    static HWND getIndustryWindow();
 
    //½»Ò×¾ä±ú
    static HWND getTradeSuccessWindow();
 
    static HWND getTradeDelegateWindow();
 
 
    //¼ì²â»·¾³
    static bool checkEnv();
 
    //
    static GPCodeArea splitPlateMenuArea(cv::Mat img);
 
    //°å¿éÄÚÈÝ·Ö¸î
    static std::list<int*> splitPlateRowArea(cv::Mat img);
 
    static std::list<int*> splitPlateRowArea(cv::Mat img, int start_row, int start_col, int end_row, int end_col);
 
    //´ò¿ªÍ¬»¨Ë³µÄ¸±ÆÁÄ»
    static void openL2Screen();
    static void openSecondScreen();
    static void openThirdScreen();
    static void openTradeSuccessScreen();
 
    //ÉèÖÃ¹ÉÆ±
    static bool setGP(std::string quickCode, list<std::string> codeList,RecognitionManager* recognitionManager);
    //ʶ±ð¹ÉƱ´úÂë
    static std::list<GPCodeArea>  recognitionGPArea(cv::Mat img);
 
    //ʶ±ðÊý×Ö
    static std::list<GPCodeArea>  recognitionGPCodeNum(cv::Mat img,std::list<GPCodeArea> areaList, RecognitionManager* recognitionManager);
 
    //ʶ±ð´úÂë
    static std::list<string> recognitionGPCode(cv::Mat img, RecognitionManager* recognitionManager);
 
 
    //ÉèÖûñÈ¡level2µÄ¹ÉƱÊý¾Ý
    static bool setListenL2GP(int p,string code, RecognitionManager* recognitionManager);
 
    //ÉèÖûñÈ¡level2µÄ¹ÉƱ´úÂë
    static std::map<int, string> getListenL2GPCodes(RecognitionManager* recognitionManager);
 
    //ʶ±ð°å¿éÄÚÈÝÇøÓò
    static GPCodeArea recognitionPlateContentArea(cv::Mat grayImg);
 
 
    //Ìí¼ÓÄ¿±ê±êµÄ
    static void addTargetCodes(list<std::string> codeList, RecognitionManager* recognitionManager);
 
    static std::list<GPCodeArea> getListenL2GPAreaAndCode(RecognitionManager* recognitionManager);
 
    //ͬ»¨Ë³ÊÇ·ñ¿¨ËÀ
    static bool thsIsDead();
 
};