【问题标题】:Tesseract gives warning message正方体发出警告信息
【发布时间】:2019-05-23 01:13:25
【问题描述】:

我正在使用 tess4j(4.3.1 版本),以便我可以将图像文件转换为文本文件,以便为 Lucene 准备索引。它可以正常工作,但最后会发出警告

Warning: Parameter not found: enable_new_segsearch

这是我的 pom.xml

<dependencies>
        <dependency>
            <groupId>org.ghost4j</groupId>
            <artifactId>ghost4j</artifactId>
            <version>1.0.1</version>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>5.3.1</version>
        </dependency>

        <dependency>
            <groupId>net.sourceforge.tess4j</groupId>
            <artifactId>tess4j</artifactId>
            <version>4.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.github.jai-imageio</groupId>
            <artifactId>jai-imageio-core</artifactId>
            <version>1.4.0</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.lept4j</groupId>
            <artifactId>lept4j</artifactId>
            <version>1.12.0</version>
        </dependency>

    </dependencies>

还有我的java主类:

        File imageFile = new File("samples/eurotext.pdf");
        ITesseract instance = new Tesseract();
       instance.setDatapath("E:\\tessdata");
        try {
            String result = instance.doOCR(imageFile);
            System.out.println(result);
        } catch (TesseractException e) {
            System.err.println(e.getMessage());
        }

使用以下虚拟机参数:

-Djna.library.path=${workspace_loc:/ocr-tess4j-example}/dlls/x64

dlls/x64 文件夹的内容:

  1. gsdll64.dll
  2. liblept1760.dll
  3. libtesseract400.dll

我怎样才能摆脱警告信息?

【问题讨论】:

    标签: tesseract tess4j


    【解决方案1】:

    试试:

    instance.setTessVariable("debug_file", "/dev/null");

    【讨论】:

      【解决方案2】:

      语言数据不正确。从 [https://github.com/tesseract-ocr/tessdata] 下载整个 tessdata。错误消失了。从这里得到想法 https://pdfc.inetsoftware.de/public/help/tesseract4/p/optical-character-recognition

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-09-07
        • 1970-01-01
        • 1970-01-01
        • 2018-09-27
        • 2010-11-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多