Home >Database >Mysql Tutorial >Opencv 2.4.10 +VS2010 项目配置记录

Opencv 2.4.10 +VS2010 项目配置记录

WBOY
WBOYOriginal
2016-06-07 15:13:411106browse

另:OpenCV入门指南: http://blog.csdn.net/morewindows/article/details/8225783 因为工作需要,小小的研究一下Opencv的图像处理,主要目的是对图像做锐化,高斯模糊等处理; 记录一下自己安装VS2010与Opencv的配置过程,方便以后查看使用,开发环境的搭建

另:OpenCV入门指南:

http://blog.csdn.net/morewindows/article/details/8225783


因为工作需要,小小的研究一下Opencv的图像处理,主要目的是对图像做锐化,高斯模糊等处理;

记录一下自己安装VS2010与Opencv的配置过程,方便以后查看使用,开发环境的搭建:

1. 下载安装Opencv,去官网http://opencv.org/即可下载最新版本的Opencv,此处用的是Opencv 2.4.10

   安装时傻瓜式的,最新版本的安装就是相当于解压到你指定的安装目录


2. 配置环境变量,我的电脑??属性??高级??环境变量

编辑PTAH:

对于32位系统,添加:

"; xx你的安装目录xx\opencv\build\x86\vc10\bin”(用“;”进行分隔) 

而对于64位系统,可以两个都添加上:

”; xx你的安装目录xx\opencv\build\x86\vc10\bin”

和”; xx你的安装目录xx\opencv\build\x64\vc10\bin”


3. VS2010中的配置

    A.工程包含目录配置

菜单栏里面点--,在新出现的“属性管理器”工作区中,点击项目->Debug|Win32->Microsoft.Cpp.Win32.userDirectories(右键属性,或者双击)即可打开属性页面。

【通用属性】 ->【VC++目录】 ->【包含目录】中添加

E:\opencv\opencv\opencv\build\include

E:\opencv\opencv\opencv\build\include\opencv

E:\opencv\opencv\opencv\build\include\opencv2 这三个目录。

注意,根据自己不同的路径修改;


    B. 工程库目录配置

属性管理器”工作区中,点击项目->Debug|Win32->Microsoft.Cpp.Win32.userDirectories(反键属性,或者双击)打开属性页面。

接着上步,就是在【通用属性】 ->【VC++目录】 ->【库目录】中,添加

E:\opencv\opencv\build\x86\vc10\lib


    C. 链接库配置

“属性管理器”工作区中,点击项目->Debug|Win32->Microsoft.Cpp.Win32.userDirectories(反键属性,或者双击)即可打开属性页面。【通用属性】 ->【链接器】->【输入】->【附加的依赖项】,添加如下内容:

opencv_ml2410d.lib
opencv_calib3d2410d.lib
opencv_contrib2410d.lib
opencv_core2410d.lib
opencv_features2d2410d.lib
opencv_flann2410d.lib
opencv_gpu2410d.lib
opencv_highgui2410d.lib
opencv_imgproc2410d.lib
opencv_legacy2410d.lib
opencv_objdetect2410d.lib
opencv_ts2410d.lib
opencv_video2410d.lib
opencv_nonfree2410d.lib
opencv_ocl2410d.lib
opencv_photo2410d.lib
opencv_stitching2410d.lib
opencv_superres2410d.lib
opencv_videostab2410d.lib


opencv_objdetect2410.lib
opencv_ts2410.lib
opencv_video2410.lib
opencv_nonfree2410.lib
opencv_ocl2410.lib
opencv_photo2410.lib
opencv_stitching2410.lib
opencv_superres2410.lib
opencv_videostab2410.lib
opencv_calib3d2410.lib
opencv_contrib2410.lib
opencv_core2410.lib
opencv_features2d2410.lib
opencv_flann2410.lib
opencv_gpu2410.lib
opencv_highgui2410.lib
opencv_imgproc2410.lib
opencv_legacy2410.lib
opencv_ml2410.lib


4.  OK,大功告成,下面就可以使用Opencv干你想干的事啦!

简单的一个测试代码

#include <iostream>  
#include <opencv2>  
#include <opencv2>  
using namespace cv;    
int main()  
{  
    Mat img=imread("pic.jpg");//读入一张图片
    namedWindow("Test");      //创建一个名为Test窗口
    imshow("Test",img);   //窗口中显示图像
    waitKey(5000);            //等待5000ms后窗口自动关闭
}  </opencv2></opencv2></iostream>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn