如何关闭tess4j中的字典?

时间:2014-10-20 11:55:16

标签: java ocr tesseract tess4j

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

1 个答案:

答案 0 :(得分:2)

如下:

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);

参考文献:
http://tesseract-ocr.googlecode.com/svn/trunk/doc/tesseract.1.html
http://tess4j.sourceforge.net/docs/docs-1.4/

相关问题