Tesseract OCR

Tesseract OCR Tuitor

environment preparement

  1. get the tesseract dll, nuget from vs.
  2. 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());
posted @ 2016-07-10 16:38  kongshu  阅读(155)  评论(0编辑  收藏  举报