1、解压opencv-3.0.0至D:\Program Files
2、环境变量 配置
将D:\ProgramFiles\opencv\build\x86\vc12\bin\和
D:\ProgramFiles\opencv\build\x64\vc12\bin
都添加至系统变量(这样,可以 在编译器Win32和X64两者中切换)
3、包含目录 配置
通用属性->VC++目录->包含目录 中添加:
D:\Program Files\opencv\build\include
D:\Program Files\opencv\build\include\opencv
D:\Program Files\opencv\build\include\opencv2
4、库目录 配置
通用属性->VC++目录->库目录 中添加:
D:\Program Files\opencv\build\x86\vc12\lib
5、链接器 配置
通用属性->链接器->输入->附加依赖项 中添加:
opencv_world300d.lib
opencv_ts300d.lib
(Debug版本有d结尾,release版本无)
opencv2.4.9则添加以下.lib文件
opencv_ml249d.lib
opencv_calib3d249d.lib
opencv_contrib249d.lib
opencv_core249d.lib
opencv_features2d249d.lib
opencv_flann249d.lib
opencv_gpu249d.lib
opencv_highgui249d.lib
opencv_imgproc249d.lib
opencv_legacy249d.lib
opencv_objdetect249d.lib
opencv_ts249d.lib
opencv_video249d.lib
opencv_nonfree249d.lib
opencv_ocl249d.lib
opencv_photo249d.lib
opencv_stitching249d.lib
opencv_superres249d.lib
opencv_videostab249d.lib
6、在Windows文件夹下加入动态链接库
两种方法都可
(1)重启电脑
(2)不重启电脑,将
D:\Program Files\opencv\build\x86\vc12\bin 下的所有dll文件拷贝至
C:\Windows\SysWOW64 中,即完成配置。