1. 配置环境变量
在环境变量中需要添加bin路径,具体是在Path中添加:
C:\OpenCV\build\x86\vc10\bin;
2. 添加包含文件
在项目属性中,(属性——配置属性——VC++目录——包含文件)中添加以下路径:
C:\OpenCV\build\include;
C:\OpenCV\build\include\opencv
C:\OpenCV\build\include\opencv2
3. 添加库文件
在第2步的同一页面下,(属性——配置属性——VC++目录——库文件)中添加以下路径:C:\OpenCV\build\x86\vc10\lib
4. 配置附加依赖库
在(链接器——输入——附加依赖项)处增加以下依赖库:
4.1 debug版
opencv_calib3d243d.lib; opencv_contrib243d.lib; opencv_core243d.lib; opencv_features2d243d.lib; opencv_flann243d.lib; opencv_gpu243d.lib; opencv_haartraining_engined.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;
4.2 release版
opencv_calib3d243.lib; opencv_contrib243.lib; opencv_core243.lib; opencv_features2d243.lib; opencv_flann243.lib; opencv_gpu243.lib; opencv_haartraining_engine.lib; opencv_highgui243.lib; opencv_imgproc243.lib; opencv_legacy243.lib; opencv_ml243.lib; opencv_nonfree243.lib; opencv_objdetect243.lib; opencv_photo243.lib; opencv_stitching243.lib; opencv_ts243.lib; opencv_video243.lib; opencv_videostab243.lib