-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtesseract.h
31 lines (19 loc) · 924 Bytes
/
tesseract.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
#ifndef GENSHINIMPACT_PAIMONSHUTUP_CPP_TESSERACT_H
#define GENSHINIMPACT_PAIMONSHUTUP_CPP_TESSERACT_H
#include <iostream>
#include <baseapi.h>
#include <allheaders.h>
#include "opencv2/core.hpp"
#include <urlmon.h>
#pragma comment(lib, "urlmon.lib")
#define AUTOMATIC_PAGE_SEGMENTATION "3" // Tesseract's automatic page segmentation
#define OEM_DEFAULT "3" // Teseract's default ORC Engine mode
#define min(a, b) (((a) < (b)) ? (a) : (b))
int InitTesseract(const char *dataPath, const char *language);
void DestroyTesseract();
std::string StripText(const std::string &input);
std::string GetTextFromImage(const cv::Mat &image);
unsigned int LevenshteinDistance(const std::string &s1, const std::string &s2);
bool IsStringsSimilar(std::string s1, std::string s2, int maxDifference);
void DownloadTessdataFileIfNecessary(const std::string &language);
#endif //GENSHINIMPACT_PAIMONSHUTUP_CPP_TESSERACT_H