简体   繁体   中英

JavaCV-OpenCV error

I want to capture my webcam on a easy way into Java. I followed this tutorial with JavaCV and 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). (x64 bit, does it matter Netbeans is x86?)

Or does anybody know an other lib that easily captures a cam in java?

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. Or this might be issue because you have installed both x64 and x86 version of thet Visual C++ redistribuables that Romain is saying.

I suggest you to follow the steps I described here JavaCV : eclipse project configuration windows ? 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"

Hope this helps.

UPDATE:

An easier and simpler step to configure JavaCV is available. Please check the link below:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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