java configuration opencv-in EclipseCategory: OpenCV2014-01-17 11:11 2002 People readComments (5)CollectionReport
Download Opencv2.4.4.exe
Unzip and install to d:/. The root directory. I named it for d:/opencv244, which contains a folder such as build.
Create a new project in Eclipse HELLOCV
(You can refer to the website steps
http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html)
I am a little bit different from the official website configuration. Two steps in the countdown.
The steps are as follows:
Right-click on Project--build path--configure build Path
Select the user library after selecting the Add library.
Next follow the instructions in user libraries
Select New
The name of your own version is 2.4.4, so take a name ~
Select the red circle option below
This time select Opencv-244.jar this thing under the OpenCV folder you installed. For me it is under the d:/opencv244.
The specific path is D:\opencv244\opencv\build\java inside
Then select Native Library location Select Edit
Next Select D:/opencv244/build\java\x86
Note here the path must be careful, is the build of the Java x86. My classmates saw the x86 on the bottom of the build, and then the old error.
Note that if it is a 64-bit machine, choose x64, which is d:/opencv244/build\java\x64
My machine is 64-bit, the beginning of the selection of x86 error.
Then ok ok ok.
Then create a new test file Main.java
[Java]View Plaincopy
- import org.opencv.core.*;
- public class main {
- public static void
- system.out.println ( "welcome to opencv " + core.version);
- system.loadlibrary (Core.NATIVE_LIBRARY_NAME) ;
- mat m = mat.eye (3 3 , cvtype.cv_ 8UC1);
- system.out.println ( "m = "
- }
- }
Run to see the output
From for notes (Wiz)
Java Configuration opencv-in eclipse