我們正在嘗試使用圖像處理爲停車系統制作軟件。我們使用OCR。我們打算在車輛離開和進入時使用網絡攝像頭獲取車牌圖像。然後我們將使用這個數字來計算公園內花費的時間以及基於此的價格。 這是我的代碼:無法加載庫'libtesseract302':找不到模塊(Windows10)
import java.io.File;
import net.sourceforge.tess4j.ITesseract;
import net.sourceforge.tess4j.Tesseract1;
import net.sourceforge.tess4j.TesseractException;
public class TestOCR {
public static void main(String[] args) {
File imageFile = new File("C:"+File.separator+"projects"+File.separator+"plate.tif");
//ITesseract instance = new Tesseract(); // JNA Interface Mapping
ITesseract instance = new Tesseract1(); // JNA Direct Mapping
try {
//String result = instance.doOCR(imageFile);
//stem.out.println(result);
} catch (Exception e) {
System.err.println(e.getMessage());
}
}
}
當我運行它,我得到這個錯誤:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract302': The specified module could not be found.
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:145)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:188)
at com.sun.jna.Library$Handler.<init>(Library.java:123)
at com.sun.jna.Native.loadLibrary(Native.java:255)
at com.sun.jna.Native.loadLibrary(Native.java:241)
at net.sourceforge.tess4j.TessAPI.<clinit>(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at com.nadeem.app.ocr.TesseractExample.main(TesseractExample.java:16)
最初我們有一個NoSuchFieldError和使用Maven來解決我們遇到了這個問題之後。
Add th完整的Stacktrace。 – Jens
我添加了完整的Stacktrace – Shalindra
看起來你還沒有安裝原生庫 – Jens