Win7在VS2010中安装OpenCv-2.4.5的详细步骤
- 格式:pdf
- 大小:1.10 MB
- 文档页数:17
图像增强和去雾说明文档文件夹说明:以下文件夹中的工程配置的opencv解压位置为F:\opencvXP系统下VS2010+Opencv-2.4.7的配置1.安装软件安装OpenCV-2.4.7,双击解压到F:\opencv(可设置任意路径,假设为%opencv%,本文中%opencv%代表opencv2.4.7解压路径的完整路径)。
安装VS2010,安装。
2.配置OpenCV环境变量计算机->(右键)属性->高级(标签)->环境变量->(双击)用户变量PATH->在变量值里面添加“%opencv%\build\x86\vc10\bin”,本机为“F:\opencv\build\x86\vc10\bin”。
3.启动VS2010,打开增强和去雾工程.sln文件。
若按步骤1、2中示例的路径正确配置,则可直接运行程序。
若opencv路径与步骤1、2中示例路径不同,按以下方法配置工程的opencv依赖。
4.配置工程的opencv依赖4.1视图(菜单项)->解决方案资源管理器->(右击)quwu_gpu->属性->配置属性->VC++目录:需要配置“包含目录”和“库目录”两项。
4.2配置“包含目录”项:添加行%opencv%\build\include%opencv%\build\include\opencv%opencv%\build\include\opencv24.3配置“库目录”项:添加行”%opencv%\build\x86\vc10\lib”即可。
4.4视图(菜单项)->解决方案资源管理器->(右击)quwu_gpu->属性->配置属性->连接器->输入->附加依赖项针对debug配置添加以下库:opencv_calib3d247d.lib opencv_contrib247d.lib opencv_core247d.lib opencv_features2d247d.lib opencv_flann247d.lib opencv_gpu247d.lib opencv_highgui247d.lib opencv_imgproc247d.lib opencv_legacy247d.lib opencv_ml247d.lib opencv_objdetect247d.lib opencv_ts247d.libopencv_video247d.lib。
OpenCV 2.4.4 安装与配置步骤一:安装OpenCV/projects/opencvlibrary/files/opencv-win/2.4.4/1.从以上地址下载OpenCV2.4.4,执行exe文件,将文件安装到所需目录。
2.建立环境变量并添加到系统路径(以将文件安装在D:\opencv为例):i) 右键点击桌面的计算机图标,选择“属性”,跳出如下窗口:ii) 点击“高级系统设置”,跳出如下窗口:iii) 点击“高级”选项卡下的“环境变量”,跳出如下窗口:iv) 点击“系统变量”下的“新建”,“变量名”输入OPENCV_BUILD,“变量值”输入D:\opencv\build(如果OpenCV解压在别的目录,请输入该目录路径。
比如,如果在C盘ProgramFiles文件夹建立了名为OpenCV的文件夹,并在其中解压,那么输入的目录就为C:\ProgramFiles\OpenCV\opencv\build,总之目录一直到build文件夹),点击“确定”。
v) 双击“用户变量”中的PATH,在跳出的窗口中输入变量值为%OPENCV_BUILD%\x86\vc10\bin (如果电脑是64位系统的,请把“x86”改为“x64”;并请确保使用的是VS 2010,因为vc10文件夹针对的是VS 2010)。
步骤二:在VS2010中配置OpenCV1. 打开VS 2010,新建一个项目(Win32控制台或MFC 都可以)。
2. 建立Debug 属性表。
i) 点击“视图”菜单中的“属性管理器”。
ii) 右键“Debug|Win32”,选中“添加新项目属性表”。
iii) 输入名称为OpenCVProjectDebug。
iv) 建立后双击属性管理器中的OpenCVProjectDebug,对其进行编辑。
v) 选择“通用属性”下的“VC++目录”,点击“包含目录”,然后点下拉条,单击“<编辑…>”。
一、VS2020安装opencv2.4.101.1首先安装vs2010安装这个就不用多谈了1.2下载opencv-2.4.10.exe,并解压到最后会在1.3添加系统变量在系统变量path后添加:C:\opencv\opencv\build\x86\vc10\bin1.4新建vc++控制台工程项目,配置1.4.1项目属性->配置属性->VC++目录->包含目录添加C:\opencv\opencv\build\includeC:\opencv\opencv\build\include\opencvC:\opencv\opencv\build\include\opencv21.4.2项目属性->配置属性->VC++目录->引用目录添加C:\opencv\opencv\build\x86\vc10\lib1.4.3项目属性->链接器->输入->附加依赖项在debug模式下添加配置方案为Debug的配置,添加:(2410代表我的opencv版本是2.4.10,需要对应更改)opencv_calib3d2410d.libopencv_contrib2410d.libopencv_core2410d.libopencv_features2d2410d.libopencv_flann2410d.libopencv_gpu2410d.libopencv_highgui2410d.libopencv_imgproc2410d.libopencv_legacy2410d.libopencv_ml2410d.libopencv_nonfree2410d.libopencv_objdetect2410d.lib opencv_ocl2410d.libopencv_photo2410d.libopencv_stitching2410d.libopencv_superres2410d.libopencv_ts2410d.libopencv_video2410d.libopencv_videostab2410d.lib配置方案为Release的配置,添加:opencv_calib3d2410.libopencv_contrib2410.libopencv_core2410.libopencv_features2d2410.lib opencv_flann2410.libopencv_gpu2410.libopencv_highgui2410.libopencv_imgproc2410.libopencv_legacy2410.libopencv_ml2410.libopencv_nonfree2410.libopencv_objdetect2410.libopencv_ocl2410.libopencv_photo2410.libopencv_stitching2410.libopencv_superres2410.libopencv_ts2410.libopencv_video2410.libopencv_videostab2410.lib二、工程中新建一个CPP文件,#include<iostream>#include<opencv2/core/core.hpp>#include<opencv2/highgui/highgui.hpp>using namespace cv;int main(){Mat img=imread("d:\\aaa.bmp");//读入一张图片namedWindow("Test");//创建一个名为Test窗口imshow("Test",img);//窗口中显示图像waitKey(5000);//等待5000ms后窗口自动关闭}。
vs2012下安装配置Opencv2.4.8要用VC++做图像处理那么首先就要安装相应的开发环境首先是VS2012其次是Opencv2.4.8准备下载开发软件首先下载VS2012自行下载,某些学校提供正版软件,如此最好,没有的话找破解版的吧……然后安装;从本站下载栏目/index.php/Download下载OpenCV for Windows,将其解压到某个目录下(我的解压路径是C:\setup\opencv);OpenCV的vs2012环境配置步骤1 打开任意一个VC++项目。
切换到VS2012左下角的标签,选择属性管理器(从菜单【视图】->属性管理器);步骤2 双击任意“er”,在弹出的属性页中设置VC++目录。
该设置方法对所有VC++项目都有效。
需要修改包含目录include files、库目录library files。
本例中即以下几个:包含目录:C: \opencv\build\includeC: \opencv\build\include\opencvC: \opencv\build\include\opencv2库目录:C: \opencv\build\x86\vc11\lib(注:当VS版本不同时,修改“vc11”至相应路径,如VS2010应配置到“vc10”)。
(最后一步环境变量路径类似)步骤3 添加lib库文件仍在上面的属性窗口中,点击链接器,选择‘输入’在‘附加依赖项’中编辑添加如下内容:opencv_core248d.libopencv_highgui248d.libopencv_video248d.libopencv_ml248d.libopencv_legacy248d.libopencv_imgproc248d.libopencv_core248.libopencv_highgui248.libopencv_video248.libopencv_ml248.libopencv_legacy248.libopencv_imgproc248.lib(注:当opencv版本不同时,修改上面文件名中的数字“248”至相应版本号,如使用OpenCV-2.3.1时应改为“231”)。
Vs2010与Opencv 配置过程一.我的opencv是安装在D盘的以下内容是按照D盘安装的步骤:1 设置环境变量:我的电脑--->右键--->属性--->高级--->环境变量--->在用户变量里,(系统环境变量和用户环境变量里面都要添加这两个位置)新建PATH和TBB两个项步骤1:在PATH中添加D:\vs2010\opencv\build\x86\vc10\bin,步骤2:添加TBB的环境变量D:\vs2010\opencv\build\common\tbb\ia32\vc10如图所示:2.步骤3 打开一个Opencv的工程,点菜单目录的“视图”--->属性管理器--->双击项目名称步骤3:在配置属性—>通用属性--->VC++目录--->包含目录文件中添加D:\vs2010\opencv \build\includeD:\vs2010\opencv \build\include\opencvD:\vs2010\opencv \build\include\opencv23::在配置属性页—>通用属性--->VC++目录--->库目录中添加:D:\vs2010\opencv \build\x86\vc10\lib如图所示:步骤5 添加lib库文件, 在配置debug里--->项目属性--->链接器--->输入--->附加依赖库里加上opencv_core242d.libopencv_highgui242d.libopencv_video242d.libopencv_ml242d.libopencv_legacy242d.libopencv_imgproc242d.lib步骤6:在配置release里--->项目属性--->链接器--->输入--->附加依赖库里加上opencv_core242.libopencv_highgui242.libopencv_video242.libopencv_ml242.libopencv_legacy242.libopencv_imgproc242.lib测试小代码如下://在(show_image)窗口下读取图片(名为opencv)// opencv2_4_2test.cpp : 定义控制台应用程序的入口点。
visualstudio2010安装教程图解(附下载地址)为了更好地⽀持 Win7 程序的开发,微软于2010年4⽉12⽇发布了 VS2010,它的界⾯被重新设计,变得更加简洁。
需要注意的是,VS2010 可以在 XP、Win7 和 Win8 下完美运⾏,但在 Win10 下可能会有兼容性问题,使⽤ Win10 的读者建议安装 VS2015 或者 VS2017。
为了满⾜不同需求的⽤户,VS2010 ⼜被细分成了五个版本,分别是专业版(Professional)、⾼级版(Premium)、旗舰版(Ultimate)、学习版(Express)和测试版(Test),其中:学习版是免费的,功能也相对简单,主要供初学者使⽤(也⾜够使⽤了)。
旗舰版是最⾼版本,功能最强⼤,收费也最贵,主要供专业的开发⼈员使⽤。
如果您由于种种原因不能⽀持正版,就只能使⽤破解版了。
虚拟光驱的安装正版的 VS 安装程序是刻录在光盘⾥⾯的,我们从互联⽹上下载的都是.iso格式的镜像⽂件。
所谓镜像⽂件,就是将光盘上的全部内容复制到电脑上后形成的⽂件。
镜像⽂件不能直接打开,需要借助虚拟光驱才能使⽤。
虚拟光驱软件⽤来模拟真实的光盘驱动,⽤虚拟光驱打开镜像⽂件,就相当于把光盘插⼊到电脑中。
常见的虚拟光驱软件有很多,这⾥我们推荐使⽤ DVDFab,它是⼀款国⼈开发的、简单易⽤的、免费的虚拟光驱。
不过⽬前这个软件有收费了,推荐⽤虚拟光驱 DVDFab Virtual Drive虚拟光驱 DVDFab Virtual Drive 1.5.11 多国语⾔安装版类型:光盘⼯具⼤⼩:650KB语⾔:简体中⽂时间:2014-09-03查看详情DVDFab 的安装⾮常简单,这⾥不再赘述,⼤家只需要注意⼀点,安装过程中 Windows 安全中⼼会发出警告,询问我们是否确定安装,如下图所⽰:⽏庸置疑,选择“安装”即可。
下载VS2010VS2010 旗舰版(Ultimate)(包含Key,已破解)下载地址:迅雷下载(较快):ed2k://|file|cn_visual_studio_2010_ultimate_x86_dvd_532347.iso|2685982720|4AE6228933DDE49D9BFA4C3467C831C2|/VS2010 的安装包⼤约有 2.5G,下载时间有点长,请⼤家耐⼼等待。
这两天在win7+64(32系统也只是在某些地方有区别,我会说明)位系统的vs2012中文版上永久配置了Opencv,发现装的时候遇到了好多问题,所以想总结一下。
一、安装OpenCV2.4.9首先下载相应的软件(win7+64位系统和vs2012中文版的安装这里就不做过多的介绍了):下载 OpenCV2.4.9: /downloads.html (选择windows 系统的,不区分x86和x64)我安装的目录是E:\opencv-2.4.9,大概有几个G,当然你也可以安装其他的版本,我没有试过,整体思路是一样的。
大概等几分钟就安装好了。
二、配置环境变量点击计算机—>右击属性—>左侧高级系统设置—>高级—>环境变量环境变量上面是用户变量,下册为系统变量。
1. 在用户变量下侧点击新建2项:变量名:OPENCV,变量值:E:\opencv-2.4.9\opencv\build;如下图变量名:PATH,变量值:E:\opencv-2.4.9\opencv\build\x64\vc11\bin;E:\opencv-2.4.9\opencv\build\x86\vc11\bin注意之间用分号分开,如下图。
2.在系统变量中找到path,必须注意,不要把系统变量path里面的值删除,而是向里面加入,以分号隔开,在里面加入以下路径对于64位系统加入:E:\opencv-2.4.9\opencv\build\x64\vc11\bin;E:\opencv-2.4.9\opencv\build\x86\vc11\bin对于32位系统加入:E:\opencv-2.4.9\opencv\build\x86\vc11\bin弄完环境变量后,最好重启以下系统。
当然在cmd中有些方法查看变量是否奏效,这里不再啰嗦,还有注意虽然我们是vs2012但是也要选vc11\bin这样的路径,而不是vc12\bin.三、vs2012工程的配置有些文档说每次新建工程都要重新配置,或者以一些啰嗦的方法配置如/lysc_forever/article/details/24272595里面说的方法,其实不用,我们完全一次性配置好而且简单,此方法是在/poem_qianmo/article/details/19809337里面学到的。
VTK亲手安装过程目录VTK亲手安装过程 (1)写在前面 (2)Windows XP 平台下利用cmake2.4配置VC6.0和VTK开发环境图文教程 (2)1,安装VC6.0。
(2)2,下载VTK相关文件 (2)3,安装cmake (3)4,解压VTK相关文件 (3)5,运行cmake。
(3)6,VC环境设置 (7)7,试一下。
(8)8,刚才只是运行VTK自带的例子,对于自己编写的工程,还需要做如下配置。
注意,此步骤和第九步结合进行。
(8)9,验证。
(9)我在Windows7下安装过程 (10)写在前面我安装VTK花费了好多时间,由于是新手,走了很多弯路。
把我的安装过程贴出来,是希望其他朋友们少兜圈子,节省时间。
由于什么都不知道,在网上找了许多VTK的资料,因为我最习惯用VC++6.0,所以都是VC++6.0下的。
VTK官网上能够下载到的最低版本是vtk 5.4.2,没有教程上说的vtk-5.0.0,只好下载了已有的vtk 5.4、vtk 5.6、vtk 5.8,经过实验,在VC++6.0下没有成功,每次在最后编译的时候出问题。
估计这些高级的版本都不能在VC6.0上用,毕竟VC++6.0也是98年的,现在都2012年了,又或者有高手能够弄出来,麻烦分享一下,就在百度文库了。
先把网上找的XP系统下vtk5.0版本的安装教程加进来,以便有人用上。
Windows XP 平台下利用cmake2.4配置VC6.0和VTK开发环境图文教程由于自己在参考网上教程进行VTK配置时出现了一些小问题,决定做一个图文并茂的教程出来。
主要参考了DIY部落的VTK安装配置教程( DIY部落>> c/c++ >> C++实例教程>> 正文)1,安装VC6.0。
2,下载VTK相关文件由于选择了VC6.0开发环境,下载了较低的版本。
VTK下载地址:vtk-5.0.4.zip 源程序vtkdata-5.0.4.zip 数据下载cmake文件网址为/HTML/Download.php依然选择了版本较低的2.4.x版本。
VS2010旗舰版下安装opencv2.3.1一、下载OpenC V for Windows(也即OpenCV-2.3.1-win-superpack.exe 文件)。
二、将OpenCV-2.3.1-win-superpack.exe解压到某个文件目录下(本文以D:\opencv2.3.1)为例三、安装CMake(不打算自己编译无需安装)下载cmake cmake-2.8.7-win32-x86.exe。
安装cmake到目录D:\ OpenCV2.3.1\cmake cmake-2.8.7-win32-x86运行cmake-gui,设置where is the source code路径为opencv安装路径(本文设置为:D:\ opencv2.3.1\opencv),设置where to build the binaries为D:\ opencv2.3.1\opencv\binary然后点Configure,会询问D:\ opencv2.3.1\opencv\binary文件夹不存在,是否创建?自然选择Yes.选择编译器,自然选择VS2010 (这里显示的是Visual Studio 10)点Finish,CMake会做一些测试,我们等待就行了,一般不会有问题。
测试结束,一些设置已经获得:这个时候设置还是红色的,再次点击Configure,确定。
这时红色的部分消失,可以看到一些路径已经设置:.点击左下方的Generate按钮,生成VS2010的项目文件。
这是我们查看硬盘D:\ opencv2.3.1 \binary文件夹,发现很多文件已经创建好了:可以看到.sln, .project配置文件均已经OK.找到OpenCV.sln文件,直接双击,用VS2010打开整个工程。
Build Solution, 分别编译Debug版和Release版:前窗口如下:此时直接编译(生成—>生成解决方案F7),这个过程会持续几分钟:然后把Debug下拉选择Release,如下图,再次编译(生成—>生成解决方案F7),同样会持续几分钟。
win7下vs2012配置opencv2.4.91.准备工作:系统:Windows 7平台:Visual Studio 2012 UltimateOpenCV:2.4.9(点此下载/)选择这里的opencv forwindows,点击就会下载到opencv2.4.9.exe。
2.解压OpenCV-2.4.9.exe解压(不是安装)到放置OpenCV的位置,例如 E:\Program Files\OpenCV249可以看到,解压后在这个文件夹里面会生成一个文件夹“opencv”,里面就是OpenCV用到的全部文件了,比如“build ”、“include”等文件夹,如下图:3.设置用户变量。
计算机>属性>高级系统设置>环境变量>新建,新建一个用户变量,如变量名:Path,变量值:C:\opencv\build\x86\vc11\bin (1)变量值有如下选择:32位VS2008:C:\opencv\build\x86\vc9\bin64位VS2008:C:\opencv1\build\x64\vc9\bin32位VS2010:C:\opencv\build\x86\vc10\bin64位VS2010:C:\opencv\build\x64\vc10\bin32位VS2012:C:\opencv\build\x86\vc11\bin64位VS2012:C:\opencv\build\x64\vc11\bin32位VS2013:C:\opencv\build\x86\vc12\bin64位VS2013:C:\opencv\build\x64\vc12\binopencv2.4.9目录如下,没有vc9(vs2008):(2)打开软件安装目录查看vs版本,可以发现我安装的vs2012是在Microsoft Visual Studio 11.0里面,同时可以看到我没有安装vs2013(vc12).(3)打开计算机>属性>高级系统设置>环境变量>新建,新建一个环境变量,变量名:path;变量值E:\opencv\build\x86\vc11\bin,点击确定,保存变量。
Win7在VS2010中安装OpenCv-2.4.5的详细步骤步骤1:Installation in WindowsTo use the OpenCV library you have two options: Installation by Using the Pre-built Libraries or Installation by Making Your Own Libraries from the Source Files. While the first one is easier to complete, it only works if you are coding with the latest Microsoft Visual Studio IDE and doesn’t take advantage of the most advanced technologies we integrate into our library.这里我们只介绍第一种方式,即Installation by Using the Pre-built Libraries1)Launch a web browser of choice and go to our page on Sourceforge(即/projects/opencvlibrary/files/opencv-win/).2)Choose a build you want to use and download it.3)Make sure you have admin rights. Unpack the self-extracting archive.4)You can check the installation at the chosen path as you can see below.5)To finalize the installation, you have to set the OpenCV enviroment variable and add it to the systems path as follows.(1)First we set an enviroment variable to make easier our work. This will hold the build directory of our OpenCV library that we use in our projects. Start up a command window(命令窗口) and enter:Here the directory is where you have your OpenCV binaries (extracted or built). You can have different platform (e.g. x64 instead of x86) or compiler type, so substitute(代替,替换)appropriate value. Inside this you should have folders like bin and include. The -m should be added if you wish to make the settings computer wise, instead of user wise.○1If you built static libraries then you are done. 即,如果你采用的是built static libraries,那么“Installation in Windows”步骤到此结束。
○2Otherwise, you need to add the bin folders path to the systems path.原因:This is cause you will use the OpenCV library in form of “Dynamic-link libraries”(also known as DLL).Inside these are stored all the algorithms and information the OpenCV library contains. The operating system (OS) will load them only on demand, during runtime. However, to do this he needs to know where they are. The systems PATH contains a list of folders where DLLs can be found. Add the OpenCV library path to this and the OS will know where to look if he ever needs the OpenCV binaries. Otherwise, you will need to copy the used DLLs right beside the applications executable file (exe) for the OS to find it, which is highly unpleasant if you work on many projects. To do this start up again the Path Editor and add the following new entry (right click in the application to bring up the menu):%OPENCV_DIR%\bin(教程的)%OPENCV2_DIR%\x86\vc10\bin(我的)Save it to the registry and you are done. If you ever change the location of your build directories or want to try out your application with a different build all you will need to do is to update the OPENCV_DIR variable via the setx command inside a command window.步骤2:How to build applications with OpenCV inside the Microsoft Visual Studio———There you will find out how to use the OpenCV library in your own projects with the help of the Microsoft Visual Studio IDE.1)对于DLL和static libraries的介绍:The OpenCV libraries, distributed by us, on the Microsoft Windows operating system are in a Dynamic Linked Libraries (DLL). These have the advantage that all the content of the library are loaded only at runtime, on demand, and that countless programs may use the same library file. This means that if you have ten applications using the OpenCV library, no need to have around a version for each one of them. Of course you need to have the dll of the OpenCV on all systems where you want to run your application.Another approach is to use static libraries that have lib extensions. You may build these by using our source files as described in the Installation in Windows tutorial. When you use this the library will be built-in inside your exe file. So there is no chance that the user deletes them, for some reason. As a drawback your application will be larger one and as, it will take more time to load it during its startup.2)得预先告诉编译器和链接器一些事儿:To build an application with OpenCV you need to do two things:∙Tell to the compiler how the OpenCV library looks. You do this by showing it the header files(头文件).∙Tell to the linker from where to get the functions or data structures of OpenCV, when they are needed.If you use the lib system you must set the path where the library files are and specify in which one of them to look. During the build the linker will look into these libraries and add the definitions and implementation of all used functions and data structures to the executable file.If you use the DLL system you must again specify all this, however now for a different reason(一个新的原因,得找到lib文件). This is a Microsoft OS specific stuff. It seems that the linker needs to know that where in the DLL to search for the data structure or function at the runtime. This information is stored inside lib files. Nevertheless, they aren’t static libraries. They are so called import libraries. This is why when you make some DLLs in Windows you will also end up with some lib extension libraries. The good part is that at runtime only the DLL is required.3)globally or locally两种方式传递信息给VS2010。