Tesseract - 找不到指定的模块

时间:2015-06-09 02:40:18

标签: java ocr tesseract tess4j

在我的Java应用程序中,我想从图像中提取文本。我下载了Google's Tesseract OCR并将其安装在我的Windows XP计算机上。我按照教程Tess4J - JNA wrapper for Tesseract,不幸的是出现了这个错误:

Exception in thread "main" java.lang.UnsatisfiedLinkError: The specified module could not be found.

at com.sun.jna.Native.open(Native Method)
at com.sun.jna.Native.open(Native.java:1759)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:260)
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 ocr.Main.main(Main.java:13)
Java Result: 1

我在 StackOverFlow 中找到了类似问题,但似乎没有任何效果。我希望你能帮助我!

这是我在Netbeans IDE 7.2中的项目结构:

enter image description here

2 个答案:

答案 0 :(得分:1)

看起来tesseract使用JNA ...尝试从这里添加它的jar https://github.com/twall/jna

答案 1 :(得分:0)

我在

中使用64位版本的dll
  

LIB \ Win32的64

文件夹

  1. API-MS-的Win-芯的Kernel32-私营L1-1-1.dll
  2. API-MS-双赢芯privateprofile-l1-1-1.dll
  3. API-MS-双赢服务私人l1-1-1.dll
  4. gsdll64.dll
  5. liblept1741.dll
  6. libtesseract3051.dll
  7. 需要Microsoft Visual C ++ 2015 Redistributable x64(vc_redist.x64.exe)。