【问题标题】:How to turn off the dictionary in tess4j?如何在 tess4j 中关闭字典?
【发布时间】:2023-03-10 18:58:02
【问题描述】:

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

【问题讨论】:

  • 您好,问题解决了吗?我有几乎相同的问题,我想使用正则表达式来提高识别的准确性,例如图像中的文本是固定文本\d\d\w\w\d\d,如何在 Java 中的 tessertact 中做到这一点

标签: java ocr tesseract tess4j


【解决方案1】:

如下:

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/

【讨论】:

  • 我认为您还必须提供空的 user_words_suffix 和 user_pattern_suffix 文件
  • 这个TessBaseAPISetVariable 来自哪里?什么包?
猜你喜欢
  • 1970-01-01
  • 2012-11-12
  • 2021-02-27
  • 1970-01-01
  • 1970-01-01
  • 2021-05-20
  • 2013-05-12
  • 1970-01-01
相关资源
最近更新 更多