Tesseract Fatal error encountered!" == NULL:Error:Assert failed:in file globaloc.cpp, line 75

huangapple go评论67阅读模式
英文:

Tesseract Fatal error encountered!" == NULL:Error:Assert failed:in file globaloc.cpp, line 75

问题

1 - 我在 GitHub 上下载了 tesdata,链接为 https://github.com/tesseract-ocr/tessdata

2 - 解压缩文件夹,并将路径传递给 Tesseract 类

3 - 运行应用程序时显示以下错误

解压缩文件夹并将路径传递给 Tesseract 类

运行应用程序时显示以下错误

执行的代码片段

public class TesseractOcrTest {
  private final String tesseractPath = "/home/tessdata/";

  @Test
  public void shouldReturnTrueIfRunOcrEquals() throws Exception {
    String result = new TesseractOcr(tesseractPath).runOcr("bw_HighResolution_en.jpeg").trim();
    assertEquals(
        "Optical Character Recognition in Java\nis made easy with the help of Tesseract", result);
  }
}

错误

Error: Illegal Parameter specification!
"Fatal error encountered!" == NULL:Error:Assert failed:in file globaloc.cpp, line 75
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f52a582d69b, pid=8957, tid=8966
#
# JRE version: OpenJDK Runtime Environment (11.0.7+10) (build 11.0.7+10-post-Ubuntu-2ubuntu218.04)
# Java VM: OpenJDK 64-Bit Server VM (11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libtesseract.so.4+0x25969b]  ERRCODE::error(char const*, TessErrorLogCode, char const*, ...) const+0x16b

注意:当我将路径从 tesdata 更改为操作系统安装路径(private final String tesseractPath = "/usr/share/tesseract-ocr/4.00/tessdata/";),我可以完美地运行。如果我指向从 GitHub 下载的 tesdata,它就无法工作。

我做错了什么?从 GitHub 下载后,是否需要进行其他配置?

英文:

1 - I downloaded tesdata on the git hub https://github.com/tesseract-ocr/tessdata

2 - Extract the folder and passed the path to the Tesseract class

3 - When running the application the following error is displayed

Extract the folder and passed the path to the Tesseract class

When running the application the following error is displayed

Code snippet executed

public class TesseractOcrTest {
  private final String tesseractPath = "/home/tessdata/";
  
  @Test
  public void shouldReturnTrueIfRunOcrEquals() throws Exception {
    String result = new TesseractOcr(tesseractPath).runOcr("bw_HighResolution_en.jpeg").trim();
    assertEquals(
        "Optical Character Recognition in Java\nis made easy with the help of Tesseract", result);
  }
}

Error

Error: Illegal Parameter specification!
"Fatal error encountered!" == NULL:Error:Assert failed:in file globaloc.cpp, line 75
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f52a582d69b, pid=8957, tid=8966
#
# JRE version: OpenJDK Runtime Environment (11.0.7+10) (build 11.0.7+10-post-Ubuntu-2ubuntu218.04)
# Java VM: OpenJDK 64-Bit Server VM (11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libtesseract.so.4+0x25969b]  ERRCODE::error(char const*, TessErrorLogCode, char const*, ...) const+0x16b

Note: When I change the path from tesdata to the OS installation path (private final String tesseractPath = "/usr/share/tesseract-ocr/4.00/tessdata/";) I can do it perfectly. It just doesn't work if I point to the tesdata downloaded from the git hub.

What am I doing wrong? When downloaded from github do you need to do any more configuration?

答案1

得分: 0

你可能使用了不兼容的语言数据。对于当前的Tesseract版本,请使用随Linux发行版提供的tesdata_besttesdata_fast,其文件大小可通过验证进行确认。

https://github.com/tesseract-ocr

英文:

You've probably used incompatible language data. For the current Tesseract verion, use tessdata_best or tessdata_fast, which comes with Linux distros. (You can verify by checking the file size.)

https://github.com/tesseract-ocr

答案2

得分: 0

Sure, here's the translated text:

  1. 确保您只安装了一个版本的Tesseract。
  2. 首先检查您使用的Tesseract版本(已安装的版本)。使用最新版本(4.x或5 alpha)。
  3. 使用Tesseract可执行文件而不是包装器进行OCR测试 - 它可以提供更多信息以找到问题。
英文:
  1. Make sure you have installed only one version of tesseract
  2. Fist check with version of tesseract you used (installed). Use the latest version (4.x or 5 alpha)
  3. Test OCR with tesseract executable instead of wrapper - it can provide more information for finding problem.

huangapple
  • 本文由 发表于 2020年8月28日 20:52:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/63634166.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定