-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathLabelOCR.h
42 lines (34 loc) · 916 Bytes
/
LabelOCR.h
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
/*
* LabelOCR.h
*
* Created on: May 1, 2014
* Author: chd
*/
#ifndef LABELOCR_H_
#define LABELOCR_H_
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <math.h>
#include <string.h>
#include <sstream>
#include <tesseract/baseapi.h>
using namespace cv;
using namespace std;
class LabelOCR
{
public:
LabelOCR();
virtual ~LabelOCR();
vector<string> runRecognition(const vector<Mat> &labelImage, int labelType);
tesseract::TessBaseAPI tess;
bool showImages;
private:
void preProcess(const Mat &InputImage, Mat &binImage);
string runPrediction1(const Mat &labelImage, int i);
string runPrediction2(const Mat &labelImage, int i);
void skeletonize(Mat& im);
void thinningIteration(Mat& im, int iter);
void filterUndesiredChars(string &str);
};
#endif /* LABELOCR_H_ */