Tess4j jar文件问题

时间:2015-07-22 07:01:54

标签: java image tess4j

import java.awt.image.RenderedImage;
import java.io.File;
import java.net.URL;

import javax.imageio.ImageIO;
import net.sourceforge.tess4j.Tesseract;

public class Tess4JSample {

public static void main(String[] args) throws Exception{

    URL imageURL = new URL("http://s4.postimg.org/e75hcme9p/IMG_20130507_190237.jpg");    
    RenderedImage img = ImageIO.read(imageURL);
    File outputfile = new File("saved.png");
    ImageIO.write(img, "png", outputfile);

    try {
    Tesseract instance = Tesseract.getInstance(); // JNA Interface Mapping

    //   Tesseract1 instance = new Tesseract1(); // JNA Direct Mapping

        String result = instance.doOCR(outputfile);
        System.out.println(result);

    } catch (Exception e) {
        System.err.println(e.getMessage());
    }

}
}

对于这个程序,我已经放了jar文件tess4j-1.5.0jai_imageio-1.1。但它仍显示error

The import net.sourceforge cannot be resolved

任何人都可以告诉我需要采取哪些必要措施来解决错误?我从堆栈溢出本身获取此程序。谢谢!提前。

0 个答案:

没有答案