Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 'tess4j' api 从 .jpg 图像中获取文本。'TessData' 文件夹打包在 jar 文件中。我想包含自定义字体并创建自己的“TessData”文件夹,有没有办法在运行时提供“TessData”位置。
我使用了下面的方法,它没有从自定义位置获取 TessData。
TessAPI1.TessBaseAPIInit3(handle, "C:\1. tesseract folder\bodoni mt\TrainData", lang);
请让我知道我们是否可以这样做。
这看起来不像是一个有效的字符串。无论如何,如果tessdata在 JAR 文件中,您需要将其解压缩并在Init方法中指定位置。
tessdata
Init