【问题标题】:How to whitelist characters in tess4j version 4.1.*如何在 tess4j 4.1 版中将字符列入白名单。*
【发布时间】:2018-08-05 19:32:39
【问题描述】:

目标是从图像中读取特定于数字的数据 (1,2,...,9,0)。 为此,我使用的是 Tess4j 版本 4.1.1。

<!-- https://mvnrepository.com/artifact/net.sourceforge.tess4j/tess4j -->
<dependency>
    <groupId>net.sourceforge.tess4j</groupId>
    <artifactId>tess4j</artifactId>
    <version>4.1.1</version>
</dependency>

我的示例代码如下所示:

ImageIO.read(new File("c:\\temp\\number1.jpg"));
ITesseract instance = new Tesseract();
instance.doOCR(img);

但由于某种原因,它会将某些数字误识别为字母。因此,为了尽量减少错误,我只需要将数字列入白名单。

这在早期的 Tess4j 版本(3.0.**)中使用TessBaseAPI 是可能的,但在当前的 4.1.* 版本中它不可用。 有人可以在这里帮助我吗,如何在 TessAPI 4.1.* 及更高版本中设置白名单字符?

【问题讨论】:

  • 你不能在 4+ 中这样做。

标签: java ocr tesseract tess4j


【解决方案1】:

自 Tesseract 4.00-alpha 以来,该功能已被破坏。还没有修复。

https://github.com/tesseract-ocr/tesseract/issues/751

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2011-12-14
  • 1970-01-01
  • 2020-03-30
  • 1970-01-01
  • 2021-02-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多