4

In my project I want to capture image from my webcam.

I configured step by step following the instructions from this "OpenCV-JavaCV : eclipse project configuration windows 7" blog post.

After configuration is finished, i tested samples codes and the application found my webcam

SETUP: Setting up device 0

SETUP: Namuga 1.3M Webcam

SETUP: Couldn't find preview pin using SmartTee

SETUP: Capture callback set

SETUP: Device is setup and ready to capture.

and then i got an error which is .dll error.

I use windows 7 x64.

Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError: C:\Users\Administrator\AppData\Local\Temp\javacpp153028723186\jniopencv_core.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(Unknown Source)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
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(Unknown Source)
at com.googlecode.javacpp.Loader.load(Loader.java:334)
at com.googlecode.javacpp.Loader.load(Loader.java:315)
at com.googlecode.javacv.cpp.opencv_core$CvArr.<clinit>(opencv_core.java:158)
at com.googlecode.javacv.VideoInputFrameGrabber.grab(VideoInputFrameGrabber.java:158)
at GrabberShow.run(GrabberShow.java:24)
at java.lang.Thread.run(Unknown Source)

How can i solve this problem?

Jeromy French
  • 11,812
  • 19
  • 76
  • 129
user1291468
  • 139
  • 1
  • 3
  • 7
  • This question has been successfully answered. Please review the answer, up vote those who helped you and click on the checkbox near the answer that has successfully solvem your problem to mark it as the official answer. – karlphillip Mar 21 '13 at 16:58

4 Answers4

4

Check whether your Opencv version and JavaCv versions are matching each other. You can check that on the readme file on javacv-bin it specifically say about the required version of the opencv.

SL_User
  • 1,934
  • 5
  • 24
  • 45
1

Unsatisfied link means that not all native code libraries required by jniopencv_core.dll could be found.

Did you deploy them all or just jniopencv_core.dll?

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • I downloaded http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/opencv-javacv-eclipse-project.html opencvSuperpack and i extracted c:\ and add environment variables. I don't understand what i should do – user1291468 May 28 '12 at 21:51
  • Were there more than one DLL file? You need for the JVM to be able to find all of them. – Thorbjørn Ravn Andersen May 28 '12 at 22:33
  • could you give me more information about how i can paths of all DLL to JVM? Best regards – user1291468 May 28 '12 at 22:43
  • I am unfamiliar with the exact software package and cannot give you better instructions. If you followed instructions exactly (including 32/64 bit versions of the JVM) then contact those who wrote it and raise a bug report. – Thorbjørn Ravn Andersen May 28 '12 at 22:45
1

I faced this problem on Windows XP and Windows 7, and this is how I fixed it on both platforms, using Netbeans 7.2:

Install all required software:

Note: make sure C:\ffmpeg\bin is a valid path.

  • OpenCV 2.4.2 (32-bit): download OpenCV-2.4.2.exe and extract it. Place its content at C:\opencv.

Note: make sure C:\opencv\build\x86\vc10\bin is valid path.

  • JavaCV 0.2: download javacv-0.2-bin.zip and extract it. Move the extracted folder to C:\javacv-bin.

  • Microsoft Visual C++ redistributable package (32-bit): download and install vcredist_x86.exe.

Configure the environment:

C:\ffmpeg\bin;C:\opencv\build\x86\vc10\bin

Now you ready to create a new Netbeans project and test your application. But before you compile it,dDon't forget to right-click the Libraries folder at the pProjects window* and click Add Jar/FOLDER to select all the .jar files located at C:\javacv-bin.

karlphillip
  • 92,053
  • 36
  • 243
  • 426
0

Make sure you have the vm arg -Djava.library.path=<path-to-native> that points to the directory with your dlls.

Jeff Storey
  • 56,312
  • 72
  • 233
  • 406