[转载]VS2010+Opencv-2.4.3的配置攻略
1、配置OpenCV环境变量
计算机->(右键)属性->高级系统设置->高级(标签)->环境变量->(双击)path(用户,系统里面的path任选其一)->在变量值里面添加” %opencv%\build\x86\vc10\bin”(里面的%opencv%记得换成自己的opencv路径。例如我的:D:\Program Files (x86)\opencv\build\x86\vc10\bin)。
2、配置工程的opencv依赖(每次新建工程都要重新配置)
1)、项目(菜单项)->…属性->VC++目录:需要配置“包含目录”和“库目录”两项。
2)、配置“包含目录”项:添加行”%opencv%\build\include”,再添加”%opencv%\build\include\opencv”和(或)”%opencv%\build\include\opencv2”。
3)、配置“库目录”项:添加行”%opencv%\build\x86\vc10\lib”即可。
4)、配置连接器:项目(菜单项)->…属性->连接器->输入->附加依赖项
针对debug配置添加以下库:
opencv_calib3d243d.lib
opencv_contrib243d.lib
opencv_core243d.lib
opencv_features2d243d.lib
opencv_flann243d.lib
opencv_gpu243d.lib
opencv_highgui243d.lib
opencv_imgproc243d.lib
opencv_legacy243d.lib
opencv_ml243d.lib
opencv_nonfree243d.lib
opencv_objdetect243d.lib
opencv_photo243d.lib
opencv_stitching243d.lib
opencv_ts243d.lib
opencv_video243d.lib
opencv_videostab243d.lib
如果是release配置(以后再说,只需要添加上面的debug配置就行了现在),则添加:
opencv_calib3d243.dll
opencv_contrib243.dll
opencv_core243.dll
opencv_features2d243.dll
opencv_ffmpeg243.dll
opencv_flann243.dll
opencv_gpu243.dll
opencv_highgui243.dll
opencv_imgproc243.dll
opencv_legacy243.dll
opencv_ml243.dll
opencv_nonfree243.dll
opencv_objdetect243.dll
opencv_photo243.dll
opencv_stitching243.dll
opencv_ts243.dll
opencv_video243.dll
opencv_videostab243.dll