TesseractOcrProvider
OCR provider backed by the Tesseract engine that extracts text from images, configurable by language packs and data path.
Definition
Namespace:Telerik.Windows.Documents.TesseractOcr
Assembly:Telerik.Windows.Documents.TesseractOcr.dll
Syntax:
public class TesseractOcrProvider : IOcrProvider
Inheritance: objectTesseractOcrProvider
Implements:
Constructors
Creates a new instance of the TesseractOcrProvider class.
public TesseractOcrProvider(string dataPath)
The path to the parent directory containing the tessdata directory. Ignored if the TESSDATA_PREFIX environment variable is set. If set to "." the tessdata directory should be in the same directory as the executable.
Properties
The path to the parent directory containing the tessdata directory. Ignored if the TESSDATA_PREFIX environment variable is set. "." by default. If left unchanged, the tessdata directory should be in the same directory as the executable.
public string DataPath { get; set; }
The language codes to use for the Tesseract OCR engine. You can find the corresponding trained data for each language and their codes here: https://github.com/tesseract-ocr/tessdata
public List<string> LanguageCodes { get; set; }
Gets or sets the granularity for recognized text (based on OcrParseLevel), which affects iterator level and output grouping.
public OcrParseLevel ParseLevel { get; set; }
Implements:
Methods
Extracts the text from an image and returns the words and their bounding rectangles.
public Dictionary<Rectangle, string> GetTextFromImage(byte[] imageBytes)
The bytes of the image.
Returns:Words with corresponding bounding rectangles
Implements: