至http://opencv.org/ 下載OpenCV,得文件:opencv-2.4.10.exe,雙擊,自解壓至:{path}\opencv
新建Java工程HelloOpenCV
添加Jar包引用,Jar包位置:{Path}\opencv\build\java\opencv-2410.jar
將文件{Path}\opencv\build\java\x64\opencv_java2410.dll拷貝至:C:\Windows\System32
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());
}