我在我的 android 应用程序中使用 Tesseract。我定义了我的“用户词”文件,并为 ocr 添加了粗线以考虑用户词文件。
String language = "deu";
datapath = getFilesDir()+ "/tesseract/";
Tess = new TessBaseAPI();
checkFile(new File(datapath + "tessdata/"));
**Tess.setVariable("user_words_suffix","deu.user-words");**
Tess.init(datapath, language);
我没有定义用户模式文件,因为我的图像中没有任何特定的模式。我只是在tessdata文件夹中复制了due.user-words的UTF-8 txt文件。这对 ocr 配置是否足够?或者我应该解压due_traindata并将这个文件添加到due_traindata然后打包吗?如果是的话,你能给我一些关于如何做到这一点的提示吗?