C# Tessnet2 OCR 根本没有返回正确的值

C# Tessnet2 OCR not returning the correct values atall

好的,所以我花了今天最好的时间试图让 ocr 正常工作并且它不再崩溃但是当我给它一个包含文本而不是数字的文件时,很多奇怪的文本被抽出...

源代码:

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using tessnet2;

namespace OCRTest
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                var image = new Bitmap(@"C:\Users\Ryan\Documents\visual studio 2015\Projects\OCRTest\testimage.jpg");
                var ocr = new Tesseract();
                ocr.Init(@"C:\Users\Ryan\Documents\visual studio 2015\Projects\OCRTest\tessdata", "eng", true);
                var result = ocr.DoOCR(image, Rectangle.Empty);
                foreach (Word word in result)
                {
                    Console.WriteLine("{0} : {1}", word.Confidence, word.Text);
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
            Console.ReadLine();
        }
    }
}

就像我说的,我正在使用 tessnet2 和 eng tessdata。

当我输入这张图片时:

我从程序中得到这样的响应:

在此先感谢您提供的任何帮助或指向您可能拥有的更多教程的链接 - 我按照 this 教程到目前为止.. Ryan

解决了这个问题 - 我做了一个愚蠢的事情,将 ocr.Init() 的最后一个参数设置为 true 而不是 false...