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

本文详细记录了如何在Win7系统下使用VS2010配置OpenCV2.1的过程,包括下载、安装及在IDE中设置路径等步骤。

由于要重新开发一个基于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++.

转载于:https://www.cnblogs.com/hardison/p/4561871.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值