[置顶] VS2010+opencv2.4.9安装

                  VS2010+opencv2.4.9安装
1、 在Opencv的中文网站下载opencv2.4.9版本的exe文件。
2、 放在指定的文件夹下进行解压,我是放在了D:\Program Files文件夹下。
3、 进行环境变量的配置,计算机—>属性—>高级系统设置—>环境变量—>系统变量—>path,添加D:\Program Files\opencv\build\x86\vc10\bin。
4、 打开vs2010,新建一个win32控制台应用程序的项目,在菜单—>视图—>属性管理器,会有debug|win32和release|win32,先只是要配置debug|win32,双击Microsoft.Cpp.Win32.user
   4.1 VC++目录—>包含目录,添加
      D:\Program Files\opencv\build\include
      D:\Program Files\opencv\build\include\opencv
      D:\Program Files\opencv\build\include\opencv2
   4.2 VC++目录—>库目录,添加
      D:\Program Files\opencv\build\x86\vc10\lib
   4.3 连接器—>输入,添加
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
5、 重启电脑
6、 测试用例
#include<iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat img=imread("D:\\4.jpg");
imshow("游戏原画",img);
waitKey(6000);
return 0;
}

你可能感兴趣的:(VS2010,OpenCV2.4.9)