首先去官网下载OpenCV并安装,接着新创建一个Java项目:OpenCV1
2. 配置Java Build Path:
2.1 右击项目OpenCV1 -> Build Path -> Configure Build Path -> Libraries -> AddLibrary;
2.2 选择 User Library,依次点击Next -> User Libraries -> New;
2.3 在弹出来的对话框中输入opencv-3.2.0,然后点击OK;
2.4 选择Add External JARs, 在OpenCV安装根目录下找到opencv-320.jar文件并添加;
2.5 然后选择Native library location:(None),点击右侧Edit 添加 G:\opencv\build\java\x64(选择自己OpenCV安装目录),然后点击OK