1. 下载安装:点击自解压OpenCV2.4.9。
2. 环境变量:PATH中加入” F:\opencv\build\x86\vc10\bin”
3. VS2010配置:
3.1 设置头文件,c/c++ > General > Additional Include Directories加入:
F:\opencv\build\include;F:\opencv\build\include\opencv;F:\opencv\build\include\opencv2;
3.2 设置库目录,Linker > General > Additional Library Directories加入:
F:\opencv\build\x86\vc10\lib;
3.3.设置库文件,Linker > General > Additional Dependencies加入:
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 opencv_objdetect249.lib opencv_ts249.lib opencv_video249.lib opencv_nonfree249.lib opencv_ocl249.lib opencv_photo249.lib opencv_stitching249.lib opencv_superres249.lib opencv_videostab249.lib 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
4. OpenCV2.4.9自带示例,源码位置:F:\opencv\sources\samples\cpp\tutorial_code,先下载CMake的Windows版2.8.12.2。通过CMake生成VS的代码。点两次Configure,再点Generate,生成示例的VS工程。
时间: 2024-10-05 01:32:28