我在电脑上安装了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.
在命令行中键入设置TESSDATA_PREFIX,会提示没有这样的变量。但是tesseract记得它(不知道如何)。那么我该如何强制tesseract在特定文件夹中搜索训练数据?谢谢。