Table of Contents

Method Create

Namespace
OpenCvSharp.Text
Assembly
OpenCvSharp.dll

Create(string?, string?, string?, OcrEngineMode, PageSegMode)

Creates an instance of the OCRTesseract class. Initializes Tesseract.

public static OCRTesseract Create(string? datapath = null, string? language = null, string? charWhitelist = null, OcrEngineMode oem = OcrEngineMode.Default, PageSegMode psmode = PageSegMode.Auto)

Parameters

datapath string

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

language string

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

charWhitelist string

specifies the list of characters used for recognition. null defaults to "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".

oem OcrEngineMode

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

psmode PageSegMode

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

OCRTesseract