码迷,mamicode.com
首页 > Windows程序 > 详细

在Win7系统下为VS2010安装和配置OpenCV2.1

时间:2015-06-08 21:26:04      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:

由于要重新开发一个机遇OpenCV2.1的程序,因此需要在Win7系统下为VS2010安装和配置OpenCV2.1。网上找了几个教程都不能正确配置,最后找到一篇英文安装的帖子,简单明了实现了配置。为了方便自己日后查看以及其他人的可能的需要,现在将配置过程记录下来。

 

原帖请见:http://opencv-srf.blogspot.it/2011/09/getting-started-with-opencv_16.html

 

Installing & Configuring OpenCV2.1 with VS 2010

Installation 
You can download the latest OpenCV library from its sourceforge.net page. But for Windows 7, Windows Vista or Windows XP SP3 users, it is easy to download Latest OpenCV Windows executable (.exe) file and just double click it to install. 

Once you have completed installing, you need to change some settings in your IDE so that it knows where to find the library files and header files of OpenCV. I’ll demonstrate the configuring process of  Microsoft Visual Studio 2010. (The configuration process is same for  Microsoft Visual C++ 2010 Express Edition (free))
 
 
Steps to Configure Microsoft Visual Studio 2010
  • Start Microsoft Visual Studio 2010
  • Go to File>New>Project>Visual C++>Win32>Win32 Console Application. Enter a name, say "HelloWorld" for your application and then click OK
 
 
技术分享
Creating Visual C++ Application
  • In Visual Studio 2008
    • Go to ‘Tools > Options > Projects and Solutions‘
  • In Visual Studio 2010
    • Go to ‘Project > Properties‘  or  ‘Project > Helloworld Properties‘  
  • Don‘t forget to select Configurations as ‘All Configurations‘ as illustrated below
  • In the left pane, click  ‘Configuration Properties>VC++ Directories‘
    • In Include Directories, add ‘C:\OpenCV2.1\include\opencv‘
    • In Library Directories, add ‘C:\OpenCV2.1\lib‘
    • In Source Directories, add ‘C:\OpenCV2.1\src\cv; C:\OpenCV2.1\src\cvaux; C:\OpenCV2.1\src\cxcore; C:\OpenCV2.1\src\highgui; C:\OpenCV2.1\src\ml‘
技术分享
Configuring Microsoft Visual Studio for OpenCV
  • In the left pane, Click  ‘Configuration Properties > Linker > Input‘
    • In Additional Dependencies, add ‘cv210.lib; cxcore210.lib; highgui210.lib; cvaux210.lib; ml210.lib ‘
技术分享
Configuring Microsoft Visual Studio for OpenCV
 
Now you are ready to write your first computer vision program using the ‘OpenCV‘ library with Visual C++.

在Win7系统下为VS2010安装和配置OpenCV2.1

标签:

原文地址:http://www.cnblogs.com/hardison/p/4561871.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!