Configuration environment: myeclipse2013+jdk1.7 (32-bit) +OPENCV 2.4.8+win8.1 (64-bit)
OPENCV installation path: D:\USERS\OPENCV as an example
1. Importing the JAR Package
Locate Opencv-248.jar under Path D:\Users\opencv\build\java and import to the Java project.
2. Configuring DLL paths
Item properties in the imported Jar Package selection Native Library location: (None), click on the right side edit add d:\users\opencv/build/java/x86 (32-bit JDK with x86 path) and then click OK, Configuration is complete.
3. Sample Programs
import Org.opencv.core.Core;
import Org.opencv.core.CvType;
import Org.opencv.core.Mat;
Public class Main {
Public Static void Main (string[] args) {
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 =" + M.dump ());
}
}
OPENCV Configuration (Java)