简体   繁体   English

JavaCV-OpenCV错误

[英]JavaCV-OpenCV error

I want to capture my webcam on a easy way into Java. 我想以一种简单的方式捕获Java网络摄像头。 I followed this tutorial with JavaCV and OpenCV: http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/opencv-javacv-eclipse-project.html 我使用JavaCV和OpenCV跟随了本教程: http ://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/opencv-javacv-eclipse-project.html

I get this error when trying some example code: 我在尝试一些示例代码时收到此错误:

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\Francis\AppData\Local\Temp\jniopencv_core7109340164936655704.dll: Can't find dependent libraries
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
        at java.lang.Runtime.load0(Runtime.java:770)
        at java.lang.System.load(System.java:1003)
        at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:403)
        at com.googlecode.javacpp.Loader.load(Loader.java:342)
        at com.googlecode.javacpp.Loader.load(Loader.java:316)
        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:247)
        at com.googlecode.javacpp.Loader.load(Loader.java:335)
        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:247)
        at com.googlecode.javacpp.Loader.load(Loader.java:335)
        at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:91)
        at com.googlecode.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:171)
        at beeldherkenningp1.CaptureImage.captureFrame(CaptureImage.java:13)
        at beeldherkenningp1.BeeldherkenningP1.main(BeeldherkenningP1.java:37)

But al my jar's are included, Microsoft Visual C++ 2010 Redistributable Package is installed, extracted OpenCV into root and my system Path is set correct... (tryed already several times to reinstal the Visual C++ Redistributable Package). 但是我的jar都包括在内,安装了Microsoft Visual C ++ 2010可再发行组件包,将OpenCV解压缩到根目录中,并且我的系统路径设置正确...(已经尝试过几次以重新安装Visual C ++可再发行组件包)。 (x64 bit, does it matter Netbeans is x86?) (x64位,Netbeans是x86没关系吗?)

Or does anybody know an other lib that easily captures a cam in java? 还是有人知道其他可以轻松捕获Java中的cam的库?

Thanks a lot! 非常感谢!

I am the one who wrote the tutorial that you're following. 我是编写您正在关注的教程的人。

Exception in thread "main" java.lang.UnsatisfiedLinkError: 
C:\Users\Francis\AppData\Local\Temp\jniopencv_core7109340164936655704.dll: 
Can't find dependent libraries

It looks like the dll library is not in environment variable path because you didn't properly added the path of opencv. dll库似乎不在环境变量路径中,因为您没有正确添加opencv的路径。 Or this might be issue because you have installed both x64 and x86 version of thet Visual C++ redistribuables that Romain is saying. 或这可能是有问题的,因为您已经安装了Romain所说的Visual C ++可再发行对象的x64和x86版本。

I suggest you to follow the steps I described here JavaCV : eclipse project configuration windows ? 我建议您按照此处介绍的步骤执行JavaCV: Eclipse项目配置窗口 and Add the following to System Path ? 并将以下内容添加到系统路径?

Configure path 配置路径

64-bit version of the JDK:
[installation path]\build\common\tbb\intel64\vc10\;C:\opencv\build\x64\vc10\bin\;
32-bit version of the JDK:
[installation path]\build\common\tbb\ia32\vc10\;C:\opencv\build\x86\vc10\bin\;

Here [installation path] might be "C:\\opencv" 此处[installation path]可能是"C:\\opencv"

Hope this helps. 希望这可以帮助。

UPDATE: 更新:

An easier and simpler step to configure JavaCV is available. 提供了一个更容易,更简单的配置JavaCV的步骤。 Please check the link below: 请检查以下链接:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM