我的tess4j OCR应用程序中的字符识别准确性非常低。我听说关闭tess4j中的词典将通过识别单个字符来提高准确性。但是我不知道该怎么做。有人知道如何在tess4j中关闭字典吗?

最佳答案

如下:

TessBaseAPISetVariable(handle, "load_system_dawg", "F");
TessBaseAPISetVariable(handle, "load_freq_dawg", "F");


要么

setTessVariable("load_system_dawg", "F");
setTessVariable("load_freq_dawg", "F");


更新:

将以下内容放在名为bazaar的文件中,例如configs文件夹下:

load_system_dawg     F
load_freq_dawg       F


然后将文件名传递给适当的方法:

List<String> configs = Arrays.asList("bazaar");
instance.setConfigs(configs);


参考文献:
https://github.com/tesseract-ocr/tesseract/blob/master/doc/tesseract.1.asc
http://tess4j.sourceforge.net/docs/docs-1.4/

10-08 08:15