可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I tried putting all libraries in my project (it was describet like solution of this problem ) but there is still same problem.
Mat m = Highgui.imread("Koala.jpg"); Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.highgui.Highgui.imread_1(Ljava/lang/String;)J at org.opencv.highgui.Highgui.imread_1(Native Method) at org.opencv.highgui.Highgui.imread(Highgui.java:352) at Open.main(Open.java:26)
回答1:
I got the same error and the below line worked for me.
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
回答2:
Java can't currently see OpenCV, hence the linking error.
I'm on a Mac, so I link to its location on my drive:
System.load( "/opt/local/share/OpenCV/java/libopencv_java246.dylib" )
You might also be able to include the JAR directly in your lib folder in your project, but I've had success by pointing to the dylib.
回答3:
Set path as C:\opencv\build\java\x64 in your project properties. In Netbeans it is project-properties-run-vmoptions=-Djava.library.path="C:\opencv\build\java\x64"
In Eclipse, Add library Window-prreference-java-buildpath-userlibraries-new-opencv,,, Add external jars(add the opencv-300 jar) set native library inside opencv as C:\opencv\build\java\x64. And add library to our project.
and to read an image use Imgcodecs.imread, Mat img=Imgcodecs.imread("C:\Users\softroniics\Documents\NetBeansProjects\SceneRecogintion\src\com\SR\view\burj.png");