Skip to content

text_OCRTesseract_create

textfunctionOpenCV 5.0.0
import { text_OCRTesseract_create } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSdatapath, language, char_whitelist, oem
FUNCTIONtext_OCRTesseract_create
RETURN TYPEtext_OCRTesseract | null
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Creates an instance of the OCRTesseract class. Initializes Tesseract.

Note: The char_whitelist default is changed after OpenCV 4.7.0/3.19.0 from "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" to "".

text_OCRTesseract_create(datapath: EmbindString, language: EmbindString, char_whitelist: EmbindString, oem: number, psmode: number): text_OCRTesseract | null;
6 available overloads
text_OCRTesseract_create(): text_OCRTesseract | null;
text_OCRTesseract_create(datapath: EmbindString): text_OCRTesseract | null;
text_OCRTesseract_create(datapath: EmbindString, language: EmbindString): text_OCRTesseract | null;
text_OCRTesseract_create(datapath: EmbindString, language: EmbindString, char_whitelist: EmbindString): text_OCRTesseract | null;
text_OCRTesseract_create(datapath: EmbindString, language: EmbindString, char_whitelist: EmbindString, oem: number): text_OCRTesseract | null;
text_OCRTesseract_create(datapath: EmbindString, language: EmbindString, char_whitelist: EmbindString, oem: number, psmode: number): text_OCRTesseract | null;
datapath

the name of the parent directory of tessdata ended with "/", or NULL to use the system's default directory.

language

an ISO 639-3 code or NULL will default to "eng".

char_whitelist

specifies the list of characters used for recognition. NULL defaults to "" (All characters will be used for recognition).

oem

tesseract-ocr offers different OCR Engine Modes (OEM), by default tesseract::OEM_DEFAULT is used. See the tesseract-ocr API documentation for other possible values.

psmode

tesseract-ocr offers different Page Segmentation Modes (PSM) tesseract::PSM_AUTO (fully automatic layout analysis) is used. See the tesseract-ocr API documentation for other possible values.

Returns

The text_OCRTesseract | null result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.