Tesseract OCR
Tesseract OCR Tuitor
environment preparement
- get the tesseract dll, nuget from vs.
- get the test data, we can get it from github
Start to write a hello world
See code below.
// var image = new Bitmap(@"C:\LearningSpace\Tessnet\OCRTest\screenshot.bmp");
var image = Pix.LoadFromFile(@"C:\LearningSpace\Tessnet\OCRTest\screenshot.bmp");
var ocr = new TesseractEngine(@"C:\LearningSpace\Tessnet\OCRTest","eng");
// ocr.SetVariable("tessedit_char_whitelist", "0123456789");
var result = ocr.Process(image, Rect.Empty);
Console.WriteLine(result.GetText());