我在我的电脑上安装了 tesseract,它定义了 TESSDATA_PREFIX 环境变量。完全卸载 tesseract 后,我尝试以这种方式使用 tesseract API:
if (myOCR->Init("C:/Projects/project/Release/tessdata/", "rus")) {
fprintf(stderr, "Could not initialize tesseract.\n");
exit(1);
}
并收到
Error opening data file C:\Program Files (x86)\Tesseract-OCR\tessdata/rus.traine
ddata
Please make sure the TESSDATA_PREFIX environment variable is set to the parent d
irectory of your "tessdata" directory.
Failed loading language 'rus'
Tesseract couldn't load any languages!
Could not initialize tesseract.
在 cmd 中键入 set TESSDATA_PREFIX 让我知道没有这样的变量。但是 tesseract 记得它(不知道如何)。那么我如何强制 tesseract 在具体文件夹中搜索 traindata 呢?谢谢