-
Notifications
You must be signed in to change notification settings - Fork 5.8k
/
Copy pathbinarizermgr.hpp
51 lines (41 loc) · 1.51 KB
/
binarizermgr.hpp
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
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Tencent is pleased to support the open source community by making WeChat QRCode available.
// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#ifndef __OPENCV_WECHAT_QRCODE_BINARIZERMGR_HPP__
#define __OPENCV_WECHAT_QRCODE_BINARIZERMGR_HPP__
#include "zxing/binarizer.hpp"
#include "zxing/common/binarizer/adaptive_threshold_mean_binarizer.hpp"
#include "zxing/common/counted.hpp"
#include "zxing/common/binarizer/fast_window_binarizer.hpp"
#include "zxing/common/binarizer/hybrid_binarizer.hpp"
#include "zxing/common/binarizer/simple_adaptive_binarizer.hpp"
#include "zxing/zxing.hpp"
namespace cv {
namespace wechat_qrcode {
class BinarizerMgr {
public:
enum BINARIZER {
Hybrid = 0,
FastWindow = 1,
SimpleAdaptive = 2,
AdaptiveThreshold = 3
};
public:
BinarizerMgr();
~BinarizerMgr();
zxing::Ref<zxing::Binarizer> Binarize(zxing::Ref<zxing::LuminanceSource> source);
void SwitchBinarizer();
int GetCurBinarizer();
void SetNextOnceBinarizer(int iBinarizerIndex);
void SetBinarizer(vector<BINARIZER> vecRotateBinarizer);
private:
int m_iNowRotateIndex;
int m_iNextOnceBinarizer;
vector<BINARIZER> m_vecRotateBinarizer;
};
} // namespace wechat_qrcode
} // namespace cv
#endif // __OPENCV_WECHAT_QRCODE_BINARIZERMGR_HPP__