找不到使tessnet2工作的方法 [英] Cannot find a way to make tessnet2 work
问题描述
我创建了一个控制台应用程序. 添加了对tessnet2_32的引用.
I have created a console application. Added a reference to tessnet2_32.
Ocr ocr = new Ocr();
using (Bitmap bmp = new Bitmap(filename))
{
tessnet2.Tesseract tessocr = new tessnet2.Tesseract();
tessocr.Init(@"C:\temp\tessdata", "eng", false);
...
我还尝试将"C:\temp\tessdata"
更改为
C:\work\ConsoleApplication3\ConsoleApplication3
C:\work\ConsoleApplication3\ConsoleApplication3\tessdata
C:\work\ConsoleApplication3\ConsoleApplication3\bin\debug
C:\work\ConsoleApplication3\ConsoleApplication3\bin
C:\work\ConsoleApplication3\ConsoleApplication3\bin\debug\tessdata
C:\work\ConsoleApplication3\ConsoleApplication3\bin\tessdata
C:\work\ConsoleApplication3\ConsoleApplication3\debug\tessdata
C:\work\ConsoleApplication3\tessdata
C:\work\ConsoleApplication3\
tessdata
文件夹本身包含9个失败的文件夹,并被添加到所有这些位置:
The tessdata
folder itself contained 9 failed and was added to all of these locations:
eng.cube.bigrams
eng.cube.fold
eng.cube.lm
eng.cube.bigrams
eng.cube.params
eng.cube.size
eng.cube.word-freq
eng.tesseract_cube.nn
eng.traineddata
但是它始终存在于.Init行中并显示一条消息:
But it just always exists at that .Init line with a message:
The file 'z:\dev\interne\cs\tesseract-ocr-svn\dotnet\tessnet2.cpp' does not exist.
我无法想象为什么在我只有C的情况下为什么要尝试访问某些Z磁盘.或者我只是完全误解了错误.
I cannot imagine why it is trying to access some Z disk while I only have C. Or I just completely misunderstand the error.
有人能足够友善地一步一步地告诉我做什么和/或我做错了什么吗?即使阅读了30多个Google链接,我也感到完全迷失了.
Can someone be kind enough to post step by step telling what to do and/or what I am doing wrong? I feel completely lost even after reading 30+ google links.
推荐答案
您使用了错误版本的语言数据文件;您拥有的是Tesseract 3.0x. tessnet2是Tesseract 2.04的.NET包装器,因此您需要加载兼容的数据文件.
You use the wrong version of language data file; what you have is for Tesseract 3.0x. tessnet2 is .NET wrapper for Tesseract 2.04, so you will need to load compatible data file.
尝试从 https://下载tesseract-2.00.eng.tar.gz sourceforge.net/projects/tesseract-ocr-alt/files/.
这篇关于找不到使tessnet2工作的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!