【发布时间】:2015-11-08 22:26:04
【问题描述】:
我是 tesseract 的新手,对 github 页面中的不同目录有点困惑。
tesserac-ocr 代码库是我安装的。在 /usr/local/share/tessdata/ 中安装了一个 tessdata 目录
所以现在在训练 tesseract 时,我运行以下命令 -
# tesseract img.tif img box.train
我收到以下错误
Tesseract Open Source OCR Engine v3.03 with Leptonica
Error opening data file /usr/local/share/tessdata/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!
Could not initialize tesseract.
显然它无法找到 tessdata 文件夹。
所以现在我从 github (https://github.com/tesseract-ocr/tessdata) 获得了 tessdata 目录。然后将 TESSDATA_PREFIX 指向从 github 下载的 tessdata。不会改变任何东西。我收到以下错误 -
Tesseract Open Source OCR Engine v3.03 with Leptonica
read_params_file: Can't open box.train
所以我的问题是 tessdata 应该指向什么? tesseract在训练命令中从哪里获取box.train?
【问题讨论】:
-
您是否创建并检查了 box.train 文件?如果不是,您必须先使用
tesseract img.tif img batch.nochop makebox创建box.train。之后,如果您的字符被正确检测到,您将必须检查 box 文件。
标签: tesseract