gpt4 book ai didi

netbeans - Win7中的JavaCV/OpenCV错误

转载 作者:行者123 更新时间:2023-12-02 17:15:14 25 4
gpt4 key购买 nike

64位,JDK 1.7,OpenCV 2.40,代码的新版本JavaCV

package test; 

import static com.googlecode.javacv.cpp.opencv_core;
import static com.googlecode.javacv.cpp.opencv_highgui;
import com.googlecode.javacv.CanvasFrame;

public class Test{
public static void main(String args) {
final IplImage image = cvLoadImage("img1.png");
final CanvasFrame canvas = new CanvasFrame("Demo");
canvas.showImage(image);
canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
}
}

我收到上述代码的以下错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\BBPATIL\AppData\Local\Temp\javacpp173171889406337\jniopencv_core.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1928)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:418)
at com.googlecode.javacpp.Loader.load(Loader.java:368)
at com.googlecode.javacpp.Loader.load(Loader.java:315)
at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.googlecode.javacpp.Loader.load(Loader.java:334)
at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:96)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.googlecode.javacpp.Loader.load(Loader.java:334)
at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:91)
at sdmcetd.main(sdmcetd.java:11)
Java Result: 1

请任何人尽快帮助我.. !!!

最佳答案

将环境变量(例如路径,类路径)设置为openCV目录。
如果存在问题,请从Internet下载javacv-0.1.jar并将其作为您的库。

关于netbeans - Win7中的JavaCV/OpenCV错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11790490/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com