文章来源:http://www.tuicool.com/articles/fAJNz2E
由于每次要用opencv库都要配置一下,为了省事就把一篇我觉得写得很好的博文的一半贴到这里,省的我每次都要去百度
版本:VS2010+Opencv-2.4.9
每次建立工程都要配置opencv的依赖。
1、项目(菜单项)->…属性->VC++目录:需要配置“包含目录”和“库目录”两项。
2、配置“包含目录”项:添加行”D:\opencv\opencv\build\include\opencv”和D:\opencv\opencv\build\include即可。
但在运行别人的opencv项目时,可能别人直接引用了上述目录的子目录路径,如果出现include错误,则再添加”%opencv%\build\include\opencv”和(或)”%opencv%\build\include\opencv2”,即可解决问题。
3、配置“库目录”项:添加行”D:\opencv\opencv\build\x86\vc10\lib”即可。
4)、配置连接器:项目(菜单项)->…属性->连接器->输入->附加依赖项
针对debug配置添加以下库:
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_objdetect249d.lib
opencv_ts249d.lib
opencv_video249d.lib
如果是release配置(以后再说,只需要添加上面的debug配置就行了现在),则添加:
opencv_calib3d249.lib
opencv_contrib249.lib
opencv_core249.lib
opencv_features2d249.lib
opencv_flann249.lib
opencv_gpu249.lib
opencv_highgui249.lib
opencv_imgproc249.lib
opencv_legacy249.lib
opencv_ml249.lib
opencv_objdetect249.lib
opencv_ts249.lib
opencv_video249.lib