我是OpenCV
和JavaCV
的新手。我正在尝试制作人脸检测程序,但是当我运行代码时,其显示以下错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:711)
at com.googlecode.javacpp.Loader.load(Loader.java:586)
at com.googlecode.javacpp.Loader.load(Loader.java:540)
at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:134)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.googlecode.javacpp.Loader.load(Loader.java:561)
at com.googlecode.javacpp.Loader.load(Loader.java:540)
at com.googlecode.javacv.cpp.opencv_core$CvArr.<clinit>(opencv_core.java:156)
at javacvlearning.FaceDetection.main(FaceDetection.java:53)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/javacpp10358349017844/libjniopencv_core.so: libopencv_core.so.2.4: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:700)
... 9 more
我已经将-Djava.library.path="mydir/opencv-3.4.2/Build/lib"
添加到了eclipse的VM中。但是仍然出现错误。我正在使用Linux
Ubuntu
和
我的进口货是...
import java.awt.image.BufferedImage;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
import org.opencv.core.Point;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;
import org.opencv.objdetect.CascadeClassifier;
import static com.googlecode.javacv.cpp.opencv_highgui.*;
import com.googlecode.javacv.cpp.opencv_core.IplImage;
import static com.googlecode.javacv.cpp.opencv_core.cvReleaseImage;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import java.awt.image.DataBufferByte;
任何建议如何解决这个问题?
先谢谢了。