Implements Tesseract OCR extraction helpers.
More...
#include "text-recognition/pch.h"
#include "text-recognition/TesseractCore.h"
#include "core/ports/diagnostics/IDiagnostics.h"
#include "core/ports/infra/text-recognition/TextRecognitionTypes.h"
#include <tesseract/baseapi.h>
#include <leptonica/allheaders.h>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <array>
#include <filesystem>
#include <cstdlib>
#include <system_error>
Go to the source code of this file.
Implements Tesseract OCR extraction helpers.
Definition in file TesseractCore.cpp.
◆ applyPsm()
| void applyPsm |
( |
tesseract::TessBaseAPI & | ocr, |
|
|
int | psm ) |
|
static |
◆ configureForStatements()
| void configureForStatements |
( |
tesseract::TessBaseAPI & | ocr, |
|
|
const ports::Settings & | recognition ) |
|
static |
◆ executableDirectory()
| std::filesystem::path executableDirectory |
( |
| ) |
|
|
static |
◆ getWordsFromBytes()
| vector< ports::Word > getWordsFromBytes |
( |
const std::vector< uint8_t > & | data, |
|
|
const std::string & | tessdataPath, |
|
|
const ports::Settings & | recognition, |
|
|
std::shared_ptr< core::ports::diagnostics::IDiagnostics > | dbg ) |
|
static |
◆ pixFromBytes()
| Pix * pixFromBytes |
( |
const std::vector< uint8_t > & | data | ) |
|
|
static |
◆ readEnvironmentVariable()
| std::string readEnvironmentVariable |
( |
const char * | name | ) |
|
|
static |
◆ recognizeTextFromBytes()
| ports::Text recognizeTextFromBytes |
( |
const std::vector< uint8_t > & | data, |
|
|
const std::string & | tessdataPath, |
|
|
const ports::Settings & | recognition, |
|
|
std::shared_ptr< core::ports::diagnostics::IDiagnostics > | dbg ) |
|
static |
◆ resolveLanguage()
| std::string resolveLanguage |
( |
const ports::Settings & | recognition | ) |
|
|
static |
◆ resolveTessdataPath()
| std::string resolveTessdataPath |
( |
const std::string & | provided | ) |
|
|
static |
◆ toTesseractOem()
| tesseract::OcrEngineMode toTesseractOem |
( |
ports::EngineMode | mode | ) |
|
|
static |