本文以vs2013+opencv2.4.9开发环境做出演示:
1.将自己电脑\opencv\build目录下的include文件夹及\opencv\build\x86\vc12下的bin和lib文件夹拷贝到工程目录$(ProjectDir)(即stdafx.h所在目录)。
2.进入项目->属性->VC++目录下设置包含目录与库目录,具体配置如下图所示(’.\’本级目录为工程目录):
3.链接器->输入中的附加依赖项与往常一样即可:
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_ml249d.lib
opencv_nonfree249d.lib
opencv_objdetect249d.lib
opencv_ocl249d.lib
opencv_photo249d.lib
opencv_stitching249d.lib