aboutsummaryrefslogtreecommitdiff
path: root/include/libchelleport.h
blob: ef693cba18428dbee5cd3b23b52e6bb4adf237af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <tesseract/publictypes.h>
#include <vector>

// NOTE: Remember to update size and alignment in ocr hs module on change
struct OCRMatch {
  int startX, startY;
  int endX, endY;
  const char *text;
};

#define CONFIDENCE_THRESHOLD 25.
#define MIN_CHARACTER_COUNT 2

const tesseract::PageIteratorLevel RESULT_ITER_MODE = tesseract::RIL_WORD;

extern "C" {
OCRMatch *findWordCoordinates(const char *image_path, /* returns */ int *size);
}

std::vector<OCRMatch> extractTextCoordinates(const char *imagePath);

void showMatch(const OCRMatch &match);