eyemBarCode.h
2.2 KB
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
#pragma once
//
// eyemBarCode·标头
//
#ifndef __EYEM_BARCODE_H
#define __EYEM_BARCODE_H
#include "eyemLib.h"
#include "dmtx.h"
#include <zxing/common/Counted.h>
#include <zxing/Binarizer.h>
#include <zxing/MultiFormatReader.h>
#include <zxing/Result.h>
#include <zxing/ReaderException.h>
#include <zxing/common/GlobalHistogramBinarizer.h>
#include <zxing/common/HybridBinarizer.h>
#include <zxing/Exception.h>
#include <zxing/common/IllegalArgumentException.h>
#include <zxing/BinaryBitmap.h>
#include <zxing/DecodeHints.h>
#include <zxing/qrcode/QRCodeReader.h>
#include <zxing/MultiFormatReader.h>
#include <zxing/MatSource.h>
#include <zxing\oned\MultiFormatOneDReader.h>
#include <zxing\datamatrix\DataMatrixReader.h>
#include <zxing\aztec\AztecReader.h>
#include <mutex>
#include <numeric>
#include <omp.h>
using namespace zxing;
using namespace zxing::qrcode;
std::mutex mtx;
enum {
NONE,
AZTEC,
CODABAR,
CODE_39,
CODE_93,
CODE_128,
DATA_MATRIX,
EAN_8,
EAN_13,
ITF,
MAXICODE,
PDF_417,
QR_CODE,
RSS_14,
RSS_EXPANDED,
UPC_A,
UPC_E,
UPC_EAN_EXTENSION
};
#define enumtoCharArr(val) #val
//
struct tMap
{
int Label;
cv::Point Pt;
tMap(int Label, cv::Point Pt) :Label(Label), Pt(Pt) {}
};
//预处理区域
struct WaitArea
{
double C;
double angle;
bool oneD = false;
std::vector<cv::Mat> oneDMats;
cv::Mat waitArea;
cv::Point Pt;
WaitArea(cv::Mat waitArea, cv::Point Pt, double C, double angle, bool oneD, std::vector<cv::Mat> oneDMats) :waitArea(waitArea), Pt(Pt), C(C), angle(angle), oneD(oneD), oneDMats(oneDMats) {}
};
//解码结果
struct DecodeResult
{
double dAngle;
cv::Point ptResult;
std::string strResultText;
std::string strResultType;
//构造函数
DecodeResult() {};
DecodeResult(double dAngle, cv::Point ptResult, std::string strResultText, std::string strResultType) :dAngle(dAngle), ptResult(ptResult), strResultText(strResultText), strResultType(strResultType) {}
//重载>运算符
bool operator >(const DecodeResult &te)const
{
return (*this).strResultText > te.strResultText;
}
//重载==运算符
bool operator ==(const DecodeResult &te)const
{
return strcmp((*this).strResultText.c_str(), te.strResultText.c_str()) == 0;
}
};
#endif/* __EYEM_BARCODE_H */