【问题标题】:How can I use Tess4j with IntelliJ?如何将 Tess4j 与 IntelliJ 一起使用?
【发布时间】:2016-08-11 11:50:31
【问题描述】:

我想用 java 做 OCR,我用 IntelliJ。但我不知道我的项目需要哪些文件。

我的代码只是一个简单的 OCR:

import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;

import java.io.File;

public class Main {

    public static void main(String[] args) {
        System.out.println("Hello World!");
        Tesseract instance = new Tesseract();
        File f = new File("asd.jpg");

        try {
            String result = instance.doOCR(f);
            System.out.println(result);
        } catch (TesseractException e) {
            System.err.println(e.getMessage());
        }
    }
}

【问题讨论】:

  • 来自 Visual Studio / F#,现在使用 IntelliJ / SBT / Scala,我正试图围绕如何添加 tess4j... 只是在这里提供精神支持:你并不孤单。如果可以,我会写一个答案。

标签: java intellij-idea tesseract tess4j


【解决方案1】:

pom.xml上添加这个依赖

<dependency>
    <groupId>net.sourceforge.tess4j</groupId>
    <artifactId>tess4j</artifactId>
    <version>4.3.0</version>
</dependency>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-10-27
    • 1970-01-01
    • 2013-04-14
    • 2019-02-03
    • 1970-01-01
    • 2015-03-19
    • 2021-06-08
    相关资源
    最近更新 更多