Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding openCV to java buildpath in eclipse

I have problems adding openCV to the buildpath of my eclipse-project. I have followed the instructions in the tutorial on this site: http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html#create-a-simple-java-project-in-eclipse

But executing the code fragment gives this console output:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv-java2.4.4 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at camStatisticsTests.RawTests.main(RawTests.java:20)

What do I have to do in order to get openCV working with java and eclipse. i want to use it as a normal java library.

like image 862
kiltek Avatar asked May 01 '13 10:05

kiltek


People also ask

How do I import OpenCV into eclipse?

Set up OpenCV for Java in EclipseFrom the menu navigate under Java > Build Path > User Libraries and choose New... . Enter a name for the library (e.g., opencv) and select the newly created user library. Choose Add External JARs... , browse to select opencv-3xx. jar from your computer.

Can you use OpenCV with Java?

4, OpenCV supports desktop Java development using nearly the same interface as for Android development. This guide will help you to create your first Java (or Scala) application using OpenCV.

What is OpenCV library in Java?

OpenCV is a cross-platform library using which we can develop real-time computer vision applications. It mainly focuses on image processing, video capture and analysis including features like face detection and object detection.


1 Answers

I had the same problem.

It happened because I had a mistake with the 'Native library location' configuration:

Goto Eclipse -> Window -> Preferences:

Goto Eclipse -> Window -> Preferences

Goto User Libraries:

enter image description here

Make sure that your native library location path is (change c:/opencv-2.4.9 to your own opencv folder):

C:/opencv-2.4.9/build/java/x64

and not:

C:/opencv-2.4.9/build/x64

(I missed the /java folder...)

like image 92
Avi L Avatar answered Sep 28 '22 04:09

Avi L