Click or drag to resize
TesseractOcrEngine Constructor (String, String)
Initializes a new instance of the TesseractOcrEngine class.

Namespace: DevScope.Ocr.Tesseract.Windows
Assembly: DevScope.Ocr.Tesseract.Windows.x86 (in DevScope.Ocr.Tesseract.Windows.x86.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax
public TesseractOcrEngine(
	string tessdataRootPath,
	string lang
)

Parameters

tessdataRootPath
Type: SystemString
The tessdataRootPath must be the name of the parent directory of tessdata and must end in '/'. Any name after the last '/' will be stripped.
lang
Type: SystemString
The language to use (language dictionary first 3 chars). The language is(usually) an ISO 639 - 3 string or NULL will default to eng.
Remarks

The lang parameter may be a string of the form[~]<lang>[+[~]<lang>] * indicating that multiple languages are to be loaded.Eg hin + eng will load Hindi and English.

Languages may specify internally that they want to be loaded with one or more other languages, so the ~sign is available to override that.Eg if hin were set to load eng by default, then hin + ~eng would force loading only hin.The number of loaded languages is limited only by memory, with the caveat that loading additional languages will impact both speed and accuracy, as there is more work to do to decide on the applicable language, and there is more chance of hallucinating incorrect words.

WARNING: On changing languages, all Tesseract parameters are reset back to their default values. (Which may vary between languages.) If you have a rare need to set a Variable that controls initialization for a second call to Init you should explicitly call End() and then use SetVariable before Init.This is only a very rare use case, since there are very few uses that require any parameters to be set before Init.

Examples
This code snippet shows how to instantiate the ocr engine.
......
var ocrEngine = new TesseractOcrEngine(AppDomain.CurrentDomain.BaseDirectory, "eng");
ocrEngine.InitializeEngine(ocrInitParams);
......
See Also