我正在使用Java中的OCR进行一个项目,并遇到了Tess4j。我在mac上使用netbeans并且似乎没有任何初学者信息可用。我是否真的需要安装Tesseract才能使用Tess4j?如果是这样,当我分发我的软件时,我的用户必须先安装Tesseract吗?我已按照此处的说明进行操作:http://tess4j.sourceforge.net/tutorial/但我收到以下错误消息:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'tesseract': Native library (darwin/libtesseract.dylib) not found in resource path ([file:/Users/unknown1/Desktop/Tess4J/lib/jai_imageio.jar, file:/Users/unknown1/Desktop/Tess4J/lib/jna.jar, file:/Users/unknown1/Desktop/Tess4J/lib/commons-io-2.4.jar, file:/Users/unknown1/Desktop/Tess4J/build/classes/, file:/Users/unknown1/NetBeansProjects/TesseractExample/build/classes/])
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
at com.sun.jna.Library$Handler.<init>(Library.java:147)
at com.sun.jna.Native.loadLibrary(Native.java:412)
at com.sun.jna.Native.loadLibrary(Native.java:391)
at net.sourceforge.tess4j.util.LoadLibs.getTessAPIInstance(LoadLibs.java:78)
at net.sourceforge.tess4j.TessAPI.<clinit>(TessAPI.java:40)
at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:360)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:273)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:205)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:189)
at tesseractexample.TesseractExample.main(TesseractExample.java:16)
/Users/unknown1/Library/Caches/NetBeans/8.1/executor-snippets/run.xml:53: Java returned: 1
BUILD FAILED (total time: 9 seconds)
任何想法我需要做什么?
答案 0 :(得分:0)
您必须首先在Mac上构建和/或安装Tesseract。一旦安装完毕,libtesseract.dylib
将可供Tess4J调用。
答案 1 :(得分:0)
您必须是64位操作系统,因此尝试安装32位操作系统JVM,或者如果必须使用64位JVM,则需要使用Tesseract和Leptonica 64位DLL。使用https://github.com/charlesw/tesseract/tree/master/src/lib/TesseractOcr/x64
提供的内容