我正尝试在 opencv 上运行一些程序,但出现此错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError:
org.opencv.objdetect.CascadeClassifier.CascadeClassifier_0(Ljava/lang/String;)J
我已经使用以下代码加载了库 libopencv_java310.so:
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
我还添加了本地库的路径。
我在互联网上搜索了很多,但出现此错误的唯一原因是未加载 native 库。出现此错误的其他原因可能是什么。
谁能帮忙……!任何帮助将不胜感激。
最佳答案
您可以将您的 System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
移动到静态 block ,以便在 opencv 的任何指令之前加载 dll。
关于java Opencv unsatisfiedLinkError, native 库已加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36321161/