VS2010+Opencv-2.4.3的配置 攻略2
vs2010上配置opencv
![vs2010上配置opencv](https://img.taocdn.com/s3/m/b3271cc82cc58bd63186bd5e.png)
图像增强和去雾说明文档文件夹说明:以下文件夹中的工程配置的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 2.4.4安装与配置](https://img.taocdn.com/s3/m/503e1517fad6195f312ba6d1.png)
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++目录”,点击“包含目录”,然后点下拉条,单击“<编辑…>”。
OPENCV 2.4.10安装
![OPENCV 2.4.10安装](https://img.taocdn.com/s3/m/503addc626fff705cc170a2a.png)
一、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后窗口自动关闭}。
VS2010安装及配置
![VS2010安装及配置](https://img.taocdn.com/s3/m/d918d96931b765ce0508141c.png)
实验一VS2010安装及配置
一. 安装
下载一个ISO镜像文件。
ISO文件截图:
可烧录成光盘,也可用虚拟光驱软件安装,也可直接解压它,然后运行里面的setup.exe进行安装。
通过虚拟光驱加载ISO镜像:
在弹出的对话框中选择下载好的ISO文件。
虚拟光驱里面已经打开了ISO文件,有的机器可能会自动弹出安装提示,有的不会。
如果自动弹出安装提示,那么直接通过即可,如果没有弹出,那么用资源管理器方式进入虚拟光驱点击Setup.exe即可开始安装。
当弹出VS2010安装程序之后点下一步,选择安装VS2010.
选择同意。
然后安装包会开始搜集信息:
开始安装。
注意安装过程中可能需要重启一两次。
二. 配置
通过开始菜单来启动VS2010。
如果是第一次开始,会让你选择默认的环境设置,选择VC的配置:
出现下面的起始页面表示已经成功安装和运行了。
常见的设置
通过菜单工具->选项调出配置对话框,下面是一些常见的设置:
⏹调出行号:选择文本编辑器->所有语言,把行号打成勾。
⏹调整字体或者颜色: 选择环境->字体和颜色。
⏹设置工具栏:单击工具栏的空白区域,把生成工具栏调出来。
可直接在工具栏上面选择编译项目、编译整个解决方案、运行程序和调试程序了。
选择生成工具栏旁边的小三角形可进行自定义,还可以添加一些按钮:
单击自定义界面下面的添加按钮就可以添加新的按钮了,现在我们把开始执行(不调试)添加工具栏中:。
vs2012下安装配置Opencv2.4.8
![vs2012下安装配置Opencv2.4.8](https://img.taocdn.com/s3/m/7b3234996bec0975f465e278.png)
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配置过程
![vs2010与opencv配置过程](https://img.taocdn.com/s3/m/53bca4e5524de518964b7d6b.png)
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 : 定义控制台应用程序的入口点。
VS2010使用说明书
![VS2010使用说明书](https://img.taocdn.com/s3/m/0448b21302d276a201292e0b.png)
VS2010全新操作软件说明书———功能更强大与操作简单并无冲突欢迎使用VS2010全新操作软件,目前该软件支持的控制卡型号有VSA系列、VSD卡、VS-mini卡、VSC++卡,暂时不支持VSB卡,请勿在VSB卡上更新VS2010软件。
在VSA系列的控制卡中,也仅支持标签颜色为白底红字的控制卡,如果错误的更新了VS2010软件将对控制卡造成不可恢复的损坏,请您谨慎使用。
目录第一部分 VS2010全新软件简介 (3)一、VS2010全新软件概述 (3)二、VS2010全新软件的运行环境及组件介绍 (4)三、VS2010操作界面简介 (5)四、软件主要功能列表 (6)五、菜单功能介绍 (6)1.文件 (6)2.编辑 (7)3.视图 (7)4.节目 (7)5.预览 (7)6.工程 (7)7.控制卡 (7)8.远程 (8)10.帮助 (8)六、快捷工具栏介绍 (8)七、对象工具箱介绍 (8)八、节目对象和属性介绍 (9)九、编辑区介绍 (9)十、系统状态栏介绍 (10)总结 (10)第二章对象的使用和编辑 (10)一、名词解释............................................. 错误!未定义书签。
二、什么是对象 (11)1.编辑对象 (11)2.显示对象 (11)三、对象与属性 (11)四、属性的编辑与对象的操作 (11)五、我们使用的对象 (12)1.编辑类对象 (12)节目和对象 (12)2.显示类对象 (13)文本文字 (13)内码文字 (14)RTF文字 (14)图片显示............................................. 错误!未定义书签。
文字节目单 (14)数字时钟 (15)模拟时钟 (15)动画 (15)表格 (15)天气信息 (15)倒计时 (16)第三章显示屏的管理 (16)一、管理的概念: (16)二、默认的环境 (16)三、发送节目 (16)四、下载节目 (16)五、工程的建立与导出 .................................. 错误!未定义书签。
VS2010使用说明书
![VS2010使用说明书](https://img.taocdn.com/s3/m/c716936e1ed9ad51f01df22c.png)
VS2010全新操作软件说明书———功能更强大与操作简单并无冲突欢迎使用VS2010全新操作软件,目前该软件支持的控制卡型号有VSA系列、VSD卡、VS-mini卡、VSC++卡,暂时不支持VSB卡,请勿在VSB卡上更新VS2010软件。
在VSA系列的控制卡中,也仅支持标签颜色为白底红字的控制卡,如果错误的更新了VS2010软件将对控制卡造成不可恢复的损坏,请您谨慎使用。
目录第一部分 VS2010全新软件简介 (3)一、VS2010全新软件概述 (3)二、VS2010全新软件的运行环境及组件介绍 (4)三、VS2010操作界面简介 (5)四、软件主要功能列表 (6)五、菜单功能介绍 (6)1.文件 (6)2.编辑 (7)3.视图 (7)4.节目 (7)5.预览 (7)6.工程 (7)7.控制卡 (7)8.远程 (8)10.帮助 (8)六、快捷工具栏介绍 (8)七、对象工具箱介绍 (8)八、节目对象和属性介绍 (9)九、编辑区介绍 (9)十、系统状态栏介绍 (10)总结 (10)第二章对象的使用和编辑 (10)一、名词解释............................................. 错误!未定义书签。
二、什么是对象 (11)1.编辑对象 (11)2.显示对象 (11)三、对象与属性 (11)四、属性的编辑与对象的操作 (11)五、我们使用的对象 (12)1.编辑类对象 (12)节目和对象 (12)2.显示类对象 (13)文本文字 (13)内码文字 (14)RTF文字 (14)图片显示............................................. 错误!未定义书签。
文字节目单 (14)数字时钟 (15)模拟时钟 (15)动画 (15)表格 (15)天气信息 (15)倒计时 (16)第三章显示屏的管理 (16)一、管理的概念: (16)二、默认的环境 (16)三、发送节目 (16)四、下载节目 (16)五、工程的建立与导出 .................................. 错误!未定义书签。
opencv2.3.1在vs2010上的配置
![opencv2.3.1在vs2010上的配置](https://img.taocdn.com/s3/m/4dcab08471fe910ef12df8ac.png)
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),同样会持续几分钟。
OpenCV安装与配置
![OpenCV安装与配置](https://img.taocdn.com/s3/m/d59da50cdc36a32d7375a417866fb84ae45cc31e.png)
OpenCV安装与配置1.下载和安装OpenCVSDK。
官网:/找到OpenCVWindows版下载下来;得到自解压程序“opencv2.x.x.exe”。
2.配置环境变量。
计算机->属性->高级系统设置->高级->环境变量->(双击)系统PATH->添加相应路径,与之前已经有的值用“;”分开。
添加:opencv\build 86\vc12\bin这个路径。
3.工程包含(include)目录配置。
文件->新建->项目->选择【Win32控制台程序】,命名test1,选择路径,单击确定;进入【Win32应用程序向导】,下一步,勾选空项目;解决方案资源管理器【源文件】右键单击->添加->新建项,新建一个.cpp文件。
【菜单栏】里单击【视图】->【属性管理器】;之后展开【Debug|Win32】->【erDirectories】,右键单击【属性】,打开属性页面.【通用属性】->【VC++目录】->【包含目录】添加3个目录:D:\ProgramFiles\opencv\build\include;D:\ProgramFiles\opencv\build\include\opencv;D:\ProgramFiles\opencv\build\include\opencv2;4.工程库(lib)配置。
【通用属性】->【VC++目录】->【库目录】添加:D:\ProgramFiles\opencv\build 86\vc12\lib;D:\ProgramFiles\opencv\build 86\vc12\statib;5.链接库配置。
【通用属性】->【链接器】->【输入】->【附加依赖项】后输入:D:\opencv\opencv\build\includeD:\opencv\opencv\build\include\opencvD:\opencv\opencv\build\include\opencv2D:\opencv\opencv\build 86\vc12\libD:\opencv\opencv\build 86\vc12\staticlibopencv_ts300d.libopencv_world300d.libIlmImfd.liblibjasperd.liblibjpegd.liblibpngd.liblibtiffd.liblibwebpd.libopencv_calib3d300d.libopencv_core300d.libopencv_features2d300d.libopencv_flann300d.lib opencv_highgui300d.lib opencv_imgcodecs300d.lib opencv_imgproc300d.lib opencv_ml300d.lib opencv_objdetect300d.lib opencv_photo300d.lib opencv_shape300d.lib opencv_stitching300d.lib opencv_superres300d.lib opencv_video300d.lib opencv_videoio300d.lib opencv_videostab300d.lib Zlibd.libopencv_ts300.lib opencv_world300.lib IlmImf.libippicvmt.lib libjasper.liblibjpeg.liblibpng.liblibtiff.liblibwebp.libopencv_calib3d300.lib opencv_core300.lib opencv_features2d300.lib opencv_flann300.libopencv_highgui300.libopencv_imgcodecs300.libopencv_imgproc300.libopencv_ml300.libopencv_objdetect300.libopencv_photo300.libopencv_shape300.libopencv_stitching300.libopencv_superres300.libopencv_video300.libopencv_videoio300.libopencv_videostab300.libZlib.lib6.在Windows下加入OpenCV动态链接库。
Opencv安装与配置(xp+vs2010+opencv2.4.9)
![Opencv安装与配置(xp+vs2010+opencv2.4.9)](https://img.taocdn.com/s3/m/16d3bdc4b9f3f90f76c61be1.png)
Opencv安装与配置(xp+vs2010+opencv2.4.9)工具:VS2010Opencv2.4.9WinXP步骤:1. 下载软件下载OpenCV-2.4.9,是个自解压文件,大小350MB左右。
双击解压到%opencv%(凡是出现%opencv%的地方均替换为你自己opencv 的路径全名,如D:\program\opencv)。
2. 配置opencv的环境变量OpenCV库函数需要通过用户环境变量调用所需要的库文件。
点击:开始->计算机(右击)->属性->高级系统设置->高级->环境变量,在用户变量里增加一项:变量名:path变量值:%opencv%\opencv\build\x86\vc10\bin如果已经有path项,在其变量值结尾添加英文分号“;”,再加上上面那个值。
这里的“x86”代表目标程序是32位的,如果要写64位的程序则选择“x64”文件夹。
并不是根据开发环境(你的机器)选择的。
后面的“vc10”代表使用Visual C++ 2010开发。
如果使用Visual Studio 2012,则填写“E:\softwares\opencv\build\x86\vc11\bin”。
OpenCV2.4.9已经为Visual Studio编译器预先配置好了动态库和静态库,因此不需要cmake再次进行编译。
1. 32位系统 & VC2010,库目录: %OpenCV%\build\x86\vc10\lib2. 64位系统 & VC2010,库目为:%OpenCV%\build\x64\vc10\lib因为2.4.9版本的opencv内嵌了TBB的功能,所以取消了TBB直接安装,这样就不需要再配置TBB环境变量了。
以上步骤完成后重启电脑使配置的环境变量生效。
3. 工程配置1) 创建一个空的Win32控制台程序opencvtest2) 配置include打开 项目---属性。
Win10win7+64位+Opencv2.4.9+vs2010
![Win10win7+64位+Opencv2.4.9+vs2010](https://img.taocdn.com/s3/m/e1991f5ccf84b9d528ea7a9d.png)
Win10/win7+64位+Opencv2.4.9+vs2010配置问题(c++语言环境)1 安装软件Opencv2.4.9下载地址:/s/1pLAk6p1 密码:l1vkVs2010下载地址:/s/1pLgyxV9 密码:kadk安装vs2010选择c++环境opencv其实就是一个解压后的文件夹,记住解压后的路径,后面配置环境变量要用,打开之后如下图,包含两个子文件build和sources,检查一下opencvbuild/include路径下有opencv 和opencv2两个子文件,include/x86和include/x64路径下都有vs10,vs11,vs12,这些是不同版本vs的二进制文件,本文要用到的是vs10,如果读者用的是更早以前的vs(比如vs2008其实就是vs9)则需要用CMAKE工具来编译你所用版本的二进制代码,此处不做详述,毕竟怎么简单怎么来,当今时代效率最重要。
2 opencv环境变量配置右键计算机属性-高级系统变量-弹出系统属性框-高级右下角-环境变量-出现环境变量对话框。
选择用户变量或者系统变量中的path变量,双击右边的值,或者单机然后编辑,把地址D:\ProgramFiles\OPENCV\opencv\build\x86\vc10\bin和D:\Program Files\OPENCV\opencv\build\x64\vc10\bin(两个地址粘贴时注意用英文分号;隔开)如果是32位系统就粘贴x86那个就行了。
粘贴到值中,保存,上面两个地址注意是你的解压地址,下面步骤的地址同理也是你的解压地址。
3 重启计算机4 工程目录配置1、打开vs2010,新建-项目-win32控制台应用程序-弹出win32应用程序导向下一步-附加项-空项目-完成2、视图-属性管理器-出现属性管理器3、先配置debug|win32(申明一下不管笔记本系统是64位还是32位,一般编写代码的环境都是win32),右键debug|win32-属性或直接双击debug|win32,出现属性页-通用属性vc++目录-包含目录添加D:\Program Files\OPENCV\opencv\build\includeD:\Program Files\OPENCV\opencv\build\include\opencvD:\Program Files\OPENCV\opencv\build\include\opencv2确定库目录下添加D:\Program Files\OPENCV\opencv\build\x86\vc10\lib确定249代表opencv版本号,debug要粘贴的文件都带d,而release则不带。
Visual Components 4.3 布局配置介绍指南说明书
![Visual Components 4.3 布局配置介绍指南说明书](https://img.taocdn.com/s3/m/ea959d2edcccda38376baf1ffc4ffe473268fd54.png)
Introduction to Layout ConfigurationVisual Components Product Family 4.3OVERVIEWIn this tutorial, you will learn about the Visual Components user interface, features, and basic tasks. The primary outcome is to allow users to quickly develop key skills and competencies for using the program. You’ll create a layout as shown below that simulates a machine tending process and an assembly process involving a human.Furthermore, you can access the Visual Components Academy to learn more about specific features and purposes that fit their simulation needs.TABLE OF CONTENTSOVERVIEW (2)1.GETTING STARTED (4)1.1 HELP DOCUMENT (4)1.2 CREATE A BASIC LAYOUT (4)1.3 RUNNING A SIMULATION (6)1.4 NAVIGATING THE 3D WORLD (8)1.5 LAYOUTS (8)2.BASIC TASKS (9)2.1 DELETE AND CLONE COMPONENTS (9)2.2 CREATE COMPONENTS (10)2.3 PROCESS MODELING (12)2.4 INTERIOR FACILITIES (19)2.5 MODIFY PROPERTIES (21)2.6 CREATE STATEMENTS (23)2.7 CONCLUSION (34)1. GETTING STARTEDOnce Visual Components is installed, open the application.1.1 HELP DOCUMENTTo learn more about the Visual Components user interface select the Help tab, where links to Help and Reference Documents, Online Support Material, and Social Media can be found. Pressing F1 opens the application’s Help Document as well.The Search tool finds tutorials and discussions on the Visual Components academy and Forum sites.1.2 CREATE A BASIC LAYOUTIn this section, you will learn to create a basic layout. Some of the contents will be explained in more details later on.By default, the eCatalog panel is visible in the Home context on the left-hand side. There is an Item Display area on the lower-left corner of the panel, which filters objects that are shown in the eCatalog .If the eCatalog or one of the other panels is not visible, it is possible to enable them through the Windows context.1.Make sure you are in the Home context. In eCatalog panel, open up the smart collection Modelsby Type. Then select PM Flow Components by Visual Components.2.Drag and drop the Feeder into the 3D world. (You can also double-click the items. When double-clicking a component, it is connected automatically to the selected component in the 3D view, if possible. Otherwise, the component appears in the world origin.)3.Select the Conveyors by Visual Components.4.Drag and drop the Conveyor into the 3D world.e the PnP tool to move the component on the floor level. Move the conveyor closer to thefeeder until a green line appears showing that a connection is possible. The line also shows the distance and direction, where the connections happen. Move it even closer, until the conveyor snaps to the predefined position. Release the mouse button and note that the yellow arrowchanges to a green arrow, which indicates that the connection is active.Note: The components shown in the 3D world are listed in the Cell Graph panel.1.3 RUNNING A SIMULATIONThe layout can be tested by running the simulation using the controls in the top center of the application.1.Run the simulation.Settings ResetRun/PauseClock DisplaySpeed DisplaySpeed SliderExport to PDF/Video/AnimationHint: Download a free Visual ComponentsExperience app for viewing the animations.Don’t forget to reset the simulation by clicking the reset button next to the play button! 2.Check the final result:3. View:The floating origin in the top left corner of the 3D world indicates the XYZ orientation of the current view. Red, Green and Blue (RGB) vector lines represent X-, Y- and Z-axes, respectively.The origin of the 3D world is indicated by a static origin positioned on the XY plane. The static origin is not shown by default, but it can be enabled in the settings:FILE > Options > Display > World Origin Frame1.4 NAVIGATING THE 3D WORLDSelect Standard views using the View Selector in the lower-left corner. The top view can be rotated by 90 degrees by clicking multiple times. The bottom view can be accessed by double-cl icking the “T”.The 3D world toolbar on the left of the viewport allows you to affect the visuals of the viewport. Use the first group to fill the view to all the components or the selected component.To interact with the 3D world’s camera to change the view of the 3D world, use the mouse to activate Orbit (Right Mouse Button click, later RMB), Pan (RMB + Left Mouse Button, later LMB), Zoom (Scroll+wheel Up/Down or Shift + RMB + drag mouse up/down) and Set Center (Ctrl + RMB on geometry or MB on geometry Center in 3D View) options with the mouse.Press F11 to toggle full-screen mode on and off.To change the default settings of the floor and the grid select FILE > Options > Display . From the display menu it is possible, for example, to disable the floor and grid visibility, show or hide the world origin frame, among other settings.1.5 LAYOUTSA layout is a file that contains information related to changes made in the 3D world. This includes, but is not limited to, components that have been added to the 3D world and their parameter values, for example, an object’s location. A layout is always displayed in the 3D world.To save a layout click the File tab, and then on the Navigation pane, click Save As . Then select Browse to define the location and the name for the output file. The default location is “…\Documents\VisualComponents\4.3\My Models ” folder for saving both, components, and layouts. All files under that folder and its subfolders appear on the My Models collection in the eCatalog . Let’s now save the layout that we created before as “Example Layout ” to My Models.Select My Models in the Collections pane. The Item Display area is updated to show the layout created in the previous section. It is possible to clear a layout by pressing CTRL+N or through the toolbar by selecting File > Clear All.2. BASIC TASKSNow you know how to set up a layout in the 3D world by adding, moving, and connecting components. Now a less basic layout will be created to learn new techniques and review those contents. The final result is a layout that demonstrates a robot doing machine tending and a human doing an assembly process. Conveyors will be used to transfer parts between stations.2.1 DELETE AND CLONE COMPONENTSComponents can be copied and pasted in the 3D world using the Copy/Paste commands in the Clipboard group of the Ribbon tab, or in the Context menu (RMB click on top of viewport). The keyboard shortcuts CTRL + C and CTRL + V can also be used.Selecting a component (LMB) in viewport opens the QuickMenu with clone and delete icons. Cloning the selected component does all the three actions at once; it copies, pastes, and connects the new component to the original one.Let’s continue the previous exercise with some new tasks! 1. Clone the Conveyor using the Clone tool from the Quick menu. 2. Hold down the CTRL key and select the two conveyors.3.Copy and paste the selected components using one of the methods taught (e.g. Ctrl + C, Ctrl + V). There are now two conveyor lines in the 3D world and notice how the pasted components did not have to be reconnected.DeleteCloneNote: If you have problems finding a component from the eCat, use the Search tool located on the top of the eCat item display.2.2 CREATE COMPONENTSThe Feeder can create any component in the 3D world if it is attached to it. 1. Expand the Models by Type collection and select type Products and Containers . 2. Drag and drop the Piston Head and place it somewhere on the 3D world. 3.Go to the Process tab and click on Products .4.Select VC_Cylinder in the Product Type Editor and on the Properties tab change the name toPistonHead.5.Click on the yellow cube on the right and select the Piston Head component.Run the simulation and check that the feeder is creating PistonHeads.2.3 PROCESS MODELINGProcess modeling allows you to quickly build and simulate machine tending applications using different resources and machines. This feature streamlines the layout planning.Next, let’s create a machine tending cell. Let’s start by getting the com ponents we need from the eCatalog.1. Expand the Models by Type collection and select type PM Flow Components .2.Drag and drop the From Conveyor Process into the 3D world and connect it to the end of the right conveyor. In this case, the From Conveyor Process acts as an input or location for picking up products.3. Drag and drop the To Conveyor Process into the 3D world. In this case, the To Conveyor Process acts as an output or location for placing products.4. Connect the To Conveyor Process to the beginning of the right conveyor.5.From the collection PM Transport Controllerdrag and drop the Robot Transport Controller into the 3D world, place it close to the From Conveyor Process . A Robot Transport Controller manages a robot that is used as a resource for picking and placing components in a machine tending process.6. Expand the Models by Type collection and select type Robot positioners from Visual Components.7.Drag and drop the Robot Floor Track and snap it to the Robot Transport Controller .8.Select both Robot Floor Track and Robot Transport Controller and turn them 90 degrees as shown in the image below.Note: Rotation can be done through the Component Properties panel, using the blue circle from the PnP selection or with the Move tool. The Component Properties panel is compatible with the other options. Here some examples:9. Select Robots from Visual Components on the eCat and Drag and Drop the Generic Articulated Robot .10.Snap it to the Robot Floor Track.11.Select Machines in the eCat, drag and drop two Parametric five-axis lathe and two Process Machine-ProLathe from Visual Component , and place them as it is shown on the image below. Notice that the doors have to be located facing the robot.Note: It is possible to remove or change the position of the chip removal for the Parametric five-axis lathe from the Properties panel.1.Go to the Process tab and click on Flow.Now we are going to create the flow for the components.2.Select the FromConveyor component and click on the label so the flow would getactualized.3.Select the Robot Controller and click on the ProLathe label, automatically, the flowfrom both machines would be created.4.With the Robot Controller , selected click on the Parametric 5-axis Lathe machine label and again the flow would get actualized.5.Click on the ToConveyor label to complete the flow.1.Run the simulation!Do you get this message below in your output panel? Let’s fix it!2.If you got this message, your robot is too far from the machines and you should drag them closer to it. One way to ensure that the robot can reach a point is using the Envelope tool. Select the Generic Robot and in the Component Properties panel, WorkSpace tab, click on Envelope , a grey globe appears covering the zones that the robot can reach. Use the Interact tool from the manipulation tab to move the robot along the floor track for checking that is also reaching the machines. Disable the envelope after this step.Note:Don’t forget to reset the simulation to return the components to the initial position.2.4 INTERIOR FACILITIESVisual Components eCat provides Interior Facilities and Factory Facilities libraries. These components are static components used for enriching the simulation environment with tables, fences, walls, and such.Let’s use some of those components!1.Expand the Models by Type collection and select type Facilities-Factory.2.Drag and drop the FenceAndWallBuilder into the 3D world.3.Click on Start Drawing and make a closed contour for the fences. During the drawing, if youwant to undo a line, you can press Undo Line. Once the drawing is finished, press End Drawingand then press Populate Components to generate the fences. The image below explains theprocess.the 3D world first by selecting it using LMB and then Delete (This does not delete the fences):Now let’s add the facilities needed for the next part:4.Expand the Models by Type collection and select type Facilities-Interior.5.Drag and drop Table A into the 3D world and place it roughly as shown in the image below.2.5 MODIFY PROPERTIESA component’s property can be edited in the Component Properties tab. The design of a component determines what parameters are available and the functionality of certain parameters.Now let’s do some changes!1.Select the last conveyor in the line and change its length so that it reaches through thefence.2. Select the panel that the Conveyor crosses and change its StandHeight to 1000.Maybe wooden tables are not the best option for an industrial environment. Let’s change the material.3. Select both tables and on the Component properties panel set the Material property toMetal .4. Let’s chan ge the height of the tables to 7002.6 CREATE STATEMENTSA Process Modeling statement is used for creating and executing specific tasks.Now we’ll create a manual assembly cell using the Process Modelling components. Let’s get thecomponents from the eCatalog.1.Expand the Models by Type collection and select type PM Transport Controller.2.Drag and drop the Human Transport Controller into the 3D world. The location of the controllerin the scene is irrelevant.3.Expand the Models by Type collection and select type PM Resources.4.Drag and drop the Human into the 3D world.5.Expand the Models by Type collection and select type Products and Containers.6.Drag and drop the Piston Rod into the 3D world.7.Expand the Models by Type collection and select type PM Warehousing.8.Drag and drop the Warehouse Shelf into the 3D world.Note: You can show the Shelf and the TopShelf of the Warehouse Shelf from the Options in theComponent Properties panel:Notice that these components don’t have to be located in a specific position or connected to another component. The Piston Rod is a template for the objects that will be created later.9. Open the PM Flow Components file.10.Drag and drop a From Conveyor Component a Feeder Process and two Process Nodes.As you can see from the picture, the Feeder Process is in a random place close to the Shelf Buffer, the Process Nodes are located on top of the tables and the From Conveyor Process is located at the end of the Conveyor.Now, let’s connect the interfaces! Components in the 3D world can be remotely connected.1.Go to the Home tab, select the Human Transport Controller, and click on Interfaces from the Connect Tab. This displays an action pane along with connection editors in the 3D world for wiring connections.2.Connect the Human Transport Controller with the Human.When the is an available connection the component would show in yellow, when the connection is done, the component would show in green.Now let’s change some settings before creating the flow: 1.Go to the Process tab click on Products -> Flow group #2 -> VC_Can , now change the name from VC_Can to PistonRod, and select it following the steps from before.2. Click on Processes select FromConveyor and change the name to ToAssembly.3.Select the Process Nodes and change the names from Process #1 to Assembly and FinalAssembly.Now let’s create the flow.The human is supposed to pick the part from the conveyor, place it in the Process Node, assemble it with the piece from the buffer and place it to the other Process Node.1.Click on Flow and select Flow Group #1 in the Process Flow Editor, connect ToConveyor toToAssembly.If you forget to click on the label, you can select the next process from the flow panel.2.Select the Human Transport Controller and connect ToAssembly to Assembly.3.Select Flow Group #2 in the Process Flow Editor and connect the Feeder to the ShelfBuffer.Select the Human Transport Controller and Connect the Buffer to Assembly and then to Final Assembly.This should be the final flow result:Now let’s modify the statements from Assembly and FinalAssembly.4. Select Processes from the Editor tab and click on Assembly.5.Select the TransportIn statement and copy these Statement Properties to accept the flow from the Piston Head (Flow Group #1):6.Click on statements and add a TransportIn Statement and an Attach Statement so that both the Piston Head and the Piston Rod will be merged.7. Now let’s modify the second TransportIn to accept the PistonRod .8.After that, attach both components and Transport them out to the FinalAseembly.9. The process is almost finished! Select the FinalAssembly and change the TransportIn to acceptthe new assembly, it is called PistonRod in this case.10. Delete the TransportOut and add a Delay and a Remove .And this is the end! Run the layout and check that everything is working!2.7 CONCLUSIONThis concludes the tutorial. Please visit Visual Components Academy to access more tutorials, videos, and webinars. Also, don’t forget to check our Forum.。
Cmake2.8.10编译OpenCV2.4.3配置VS2010终结版
![Cmake2.8.10编译OpenCV2.4.3配置VS2010终结版](https://img.taocdn.com/s3/m/ec4bc285a0116c175f0e489c.png)
我想写下这个文档的目的,是这几天被Cmake2.8.10编译OpenCV2.4.3配置VS2010,在window7,64位操作系统环境中。
本人是一个电脑新手,也仅仅是对VS2010有稍微的了解,所以配置和编译过程主要是在OpenCV中文网的“visual studio 2010下安装OpenCV及相关配置”这篇文章的参照下完成的,当然了也浏览了很多其他的相关的配置贴,但是由于时间问题,没有一一列举,总之感谢你们。
希望能帮助到你,让你顺顺利利的解决。
首先,下载文件官方地址:/projects/opencvlibrary/总之,在这个网站下,你可以下到最新的,目前下到的是OpenCV 2.4.3接着是:Cmake,可以去官网下载最新的:/目前更新到2.8.10还有就是Intel TBB了,目前已经是TBB4.1了/当这些都准备好了,就开始安装了:1、首先安装CMAKE2.8.10,放到你想的文件夹下,如本人的“D:\TBB”然后将OpenCV2.4.3,安装到你将要放置OPENCV的地方,如本人的“D:\opencv”接着,解压INTEL TBB4.1,比如将OPENCV和TBB都放在D:里面。
如本人的把他们都放在D盘下,主要是方便,担心路径的对后面配置过程的影响,反正第一次,很多东西以简单的方式进行,等以后了解了,绝对不这么做。
(PS,刚刚开始装Arcgis也是一样的,但是现在我可以把它放在任意的文件夹下了,加油,努力)接着:在一个你喜欢文件夹下创建子目录D:\Program\cv2010,用于存放编译结果。
D:\opencv\build\x86\vc10\bin;D:\TBB\bin\ia32\vc10;检查D:\opencv\build\x86\vc10\bin;D:\TBB\bin\ia32\vc10;是否已经被加入到环境变量(我的电脑-属性-环境变量)PATH,如果没有,请加入。
这里注意下,我在DB(每个人电脑不同,这里也不同)的用户变量这里也建了一个Path。
vs2010下配置opencv安装步骤
![vs2010下配置opencv安装步骤](https://img.taocdn.com/s3/m/ce6461741711cc7931b7167a.png)
1.下载和安装VS2010解压下载的文件然后双击Setup进行安装然后选择Visual C++2010学习版再点击下一步选择我已阅读并接受许可条款,再进行下一步下一步继续下一步然后自己选择安装位置,点击安装然后慢慢等待吧安装完之后点击完成,这样vs久安装好了,下面就是配置问题了。
2.在opencv官网上找到OpenCV windows版下载下来下载完后得到文件OpenCV2.4.9,双击后会提示解压到某个地方,推荐放到D:\Program Files\下,比如D:\Program Files,(因为OpenCV项目文件打包的时候,根目录就是opencv,所以我们不需要额外的新建一个名为opencv的文件夹,然后再解压,那是多此一举的事情)然后点击Extract按钮。
等一段时间,OpenCV2.4.9近3个多G的文件就解压到了D:\Program Files下。
解压之后如下图3.配置环境变量这步的配置方法如下:【计算机】->【(右键)属性】->【高级系统设置】->【高级(标签)】->【环境变量】->“双击”系统变量中的PATH->在变量值里面添加相应的路径。
如下图:配置好之后点击确定。
我这是32位的,64位的网上也有,在这就不说了。
4.工程包含(include)目录的配置<1>打开visual studio,调处行号,选择文本编辑器,所有语言,把行号打成勾。
调出生成工具栏,单击自定义界面下面的添加按钮就可以添加新的按钮了,现在我们把开始执行(不调试)添加工具栏中。
下面让我们用VC++2010也就是VC10来做一个控制台的HelloWorld程序吧。
VC2010里面不能单独编译一个.cpp或者一个.c文件,这些文件必须依赖于某一个项目,因此我们必须创建一个项目。
有很多种方法都可以创建项目,可以通过菜单:文件,新建,项目;也可以通过工具栏点击新建项目进行创建。
VS2010使用教程
![VS2010使用教程](https://img.taocdn.com/s3/m/1523799b3169a4517623a329.png)
安装、配置和首次使用VS2010(2011-1-10张威)关于传说中的C语言这一回事,非计算机专业的同学可以只需要使用TC或者是VC6.0来编程,但作为计算机业内的同学我们有必要使用功能更强大,BUG 更好的编译工具,这里我教大家如何安装和使用微软公司新的编译工具Visual Stdio 2010。
这里将帮助大家安装Visual C++ 2010,帮助大家做一些常见的配置,以及第一次使用它来写HelloWord程序。
安装Visual C++ 2010是属于Visual Studio 2010的一部分,实际上Visual C++ 2010也有更多的子版本,正如Windows7有旗舰版、家庭高级版、家庭初级版一样。
如果你下载完毕了,一般情况下是一个ISO镜像文件,这里我就就拿VS2010旗舰版(大小为2.5G)为例给大家作一下讲解。
下载地址:这就是光盘镜像文件,我们有多种方式可以安装它,你可以把它烧录成光盘,也可以用虚拟光驱软件安装它,由于这个ISO已经被修改过了,你甚至可以直接解压它,然后运行里面的setup.exe进行安装。
方法1:这里我们就直接解压它。
不解释…方法2:或者我们通过虚拟光驱加载刚才下载好的ISO镜像:在弹出的对话框中选择我们下载好的ISO文件。
这个时候,虚拟光驱里面已经替我们打开了ISO文件,有的机器可能会自动弹出安装提示,有的不会。
如果自动弹出安装提示,那么直接通过即可,如果没有弹出,那么用资源管理器方式进入虚拟光驱点击Setup.exe即可开始安装。
由于我已经安装好了VS2010,所以接下来无法给大家截图了,我就直接用文字描述吧。
当弹出VS2010安装程序之后点下一步,然后我们可能会看到完全最小自定义这样的选项,我推荐大家选择自定义,因为只有这样我们才可以自定我们安装的目录。
接下来会选择安装的组件。
这个时候我们会看到大量的VS2010的组件,这里我们可以选择是否安装Basic是否安装C#等等,我在网上找到一些图片,虽然跟中文版2010不一样,大家大概的样子是一样的,大家就凑合着看看吧。
VS2010_opencv22_pass_test
![VS2010_opencv22_pass_test](https://img.taocdn.com/s3/m/2ea38cd4ce2f0066f53322a8.png)
OpenCV-2.2.0-win32-vs2010在VS2010下的简单安装流程及实例刚刚在visual2010配置完opencv2.2,是按照下面的方法的,可行!与你分享一下。
呵呵。
希望你能成功配置。
这里只谈预编译安装包的方法,注意,安装环境只适用于VS2010(32-bit), OpenCV 2.2。
其他环境请使用CMake方法。
步骤:1.自行下载并安装OpenCV-2.2.0-win32-vs2010.exe(注意安装时选择把OpenCV 路径添加到系统全局变量中);2.在VS2010创建你自己的工程;3.打开project properties,在弹出窗口中定位到VC++ Directories;4.加入“[OpenCV安装路径]/include”、“[OpenCV安装路径]/include/opencv”这两个路径到Include Directory里面(目的是为了兼容2.1及其以前版本的引用头文件格式);5.加入“[OpenCV安装路径]/lib”路径到Library Directory里面;6.不要关闭当前窗口,定位到左边菜单中的Linker,再选择Input,把下面这些依赖项加进去:opencv_core220d.libopencv_highgui220d.libopencv_video220d.libopencv_ml220d.libopencv_legacy220d.libopencv_imgproc220d.lib当然,还有其他的库,视需要而添加;7.编写好程序或运行些实例看看是否能通过。
#include<opencv2\opencv.hpp>#include<iostream>#include<string>using namespace cv;using namespace std;int main(){Mat img = imread("D:\\My Documents\\Visual Studio 2010\\Projects\\test_opencv22\\pp.jpg");if(img.empty()){cout<<"error";return -1;}imshow("xx的Ì?靓|照?",img);waitKey();return 0;}注:pp.jpg文件放置在vc++的项目文件的根目录下。
VS2010使用OpenCV的配置过程-已通过多机实验的个人成果综合
![VS2010使用OpenCV的配置过程-已通过多机实验的个人成果综合](https://img.taocdn.com/s3/m/eaca65b8960590c69ec376e8.png)
OpenCV2.3.1和VS2010联合使用的设置过程:1.到/index.php/Download 下载OpenCV for Windows(也即OpenCV-2.3.1-win-superpack.exe 文件)。
2.将OpenCV-2.3.1-win-superpack.exe 解压并放到某个目录下,例如D:\Program Files\OpenCV-2.3.1-win-superpack\opencv (无需运行setup.exe,解压则可)。
解压后的目录结构如下图。
3.添加OpenCV的include和lib,步骤如下:在VS新建一个Win32控制台应用程序,以下以工程Opencv为例,然后选择菜单栏视图->属性管理器这时在VS编辑器右侧出现属性管理器点开之前建的工程Opencv,会看到Debug|Win32和Release|Win32两个目录点开Debug|Win32目录,找到er,双击打开找到箭头所指的”VC++目录”,打开,在右侧在”包含目录”中加入OpenCV安装目录下的E:\ProgramFiles\OpenCV-2.3.1-win-superpack\opencv\build\include; E:\ProgramFiles\OpenCV-2.3.1-win-superpack\opencv\build\include\op encv;E:\ProgramFiles\OpenCV-2.3.1-win-superpack\opencv\build\include\op encv2;在”引用目录”和”库目录”中加入安装目录下的E:\ProgramFiles\OpenCV-2.3.1-win-superpack\opencv\build\x86\vc10\lib;4.设置环境变量(系统变量和用户变量都设置)在系统变量和用户变量的Path中加入(注意不要直接复制,可能会多出个空格,调整好格式再加到环境变量中)E:\Program Files\OpenCV-2.3.1-win-superpack\opencv\build\x86\vc10 \bin;E:\Program Files\OpenCV-2.3.1-win-superpack\opencv\build\common\tbb\ia32\vc10;5.重启之后打开工程,右击工程项目,选择属性在弹出的对话框里选择”链接器->输入”Debug模式下,在右侧附加依赖项中加入opencv_calib3d231d.lib; opencv_contrib231d.lib; opencv_core231d.lib; opencv_features2d231d.lib; opencv_flann231d.lib; opencv_gpu231d.lib; opencv_highgui231d.lib; opencv_imgproc231d.lib; opencv_legacy231d.lib; opencv_ml231d.lib; opencv_objdetect231d.lib;opencv_ts231d.lib; opencv_video231d.lib;Release模式下,在右侧附加依赖项中加入opencv_calib3d231.lib; opencv_contrib231.lib; opencv_core231.lib; opencv_features2d231.lib; opencv_flann231.lib; opencv_gpu231.lib; opencv_highgui231.lib; opencv_imgproc231.lib; opencv_legacy231.lib; opencv_ml231.lib; opencv_objdetect231.lib; opencv_ts231.lib; opencv_video231.lib;工程设置完成,给个验证程序,如果例程运行过程出现cannot find or open PDB file这个错误,请参照/%D6%F3%D2%BB%B1%AD%B2%E8/blog/item/0302 b3188ef42f5143a9adf9.html的解决方法。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
VS2010+Opencv-2.4.3的配置攻略
Opencv2.4.3在VS2008和VS2010平台上安装配置图解
1、下载软件。
Opencv2.4.3可从此处下载到:
先安装VS2008或VS2010,接着把刚下载的Opencv2.4.3文件解压,建议把解压文件放在C盘,如C:\opencv,可以放在任意位置,但在下面的配置中相应把路径改下。
2、设置用户变量。
计算机>属性>高级系统设置>环境变量>新建,新建一个用
户变量,如变量名:Path,变量值:C:\opencv\build\x86\vc9\bin
变量值有如下选择:
32位VS2008:C:\opencv\build\x86\vc9\bin
64位VS2008:C:\opencv1\build\x64\vc9\bin
32位VS2010:C:\opencv\build\x86\vc10\bin
64位VS2010:C:\opencv\build\x64\vc10\bin
3、设置编译路径。
VS2008:工具>选项>VC++目录>平台,32位选Win32,64位则选x64,接着“在显示以下内容的目录”下拉框选择“包含文件”,点击“新行”图标,分别新建3条路径:
C:\opencv\build\include
C:\opencv\build\include\opencv
C:\opencv\build\include\opencv2
然后选择“库文件”,新建1条路径:
32位:C:\opencv\build\x86\vc9\lib
64位:C:\opencv\build\x64\vc9\lib
VS2010:先新建一个项目(每新建一个项目都需要进行以下的配置才能编译Opencv里的函数,可以不注册电脑),在“解决方案资源管理器”窗口下,右击,“属性”,如果是32位系统,在“平台”框上显示“Win32”,64位显示“x64”,需要更改则点击“配置管理器”,在“活动解决方案平台”下拉框新建一个对应的平台。
接着,配置属性>VC++目录,在右边“包含目录”那栏,点击编辑按钮,再分别新建以下3条路径:
C:\opencv\build\include
C:\opencv\build\include\opencv
C:\opencv\build\include\opencv2
然后选择“库目录”那栏,新建1条路径:32位:C:\opencv\build\x86\vc9\lib
32位:C:\opencv\build\x86\vc10\lib
64位:C:\opencv\build\x64\vc10\lib
4、 注销电脑,设置库文件。
重新打开VS2008新建一个c++项目(每新建一个
项目都要进行以下设置才能编译Opencv 里的函数),VS2010用回上一步所建的项目。
VS2008:在“解决方案资源管理器”窗口中,右单击项目名,选择“属性”>配置属性>链接器>输入,接着在“配置”下拉框中,选择“Debug ”,在“附加依赖项”那栏点击右边的“编辑”按钮,复制下面的库文件名到上方空白处:
opencv_calib3d243d.lib
opencv_contrib243d.lib
opencv_core243d.lib
opencv_features2d243d.lib
opencv_flann243d.lib
opencv_gpu243d.lib
opencv_highgui243d.lib
opencv_imgproc243d.lib
opencv_legacy243d.lib
opencv_ml243d.lib
opencv_nonfree243d.lib
opencv_objdetect243d.lib
opencv_photo243d.lib
opencv_stitching243d.lib
opencv_ts243d.lib
opencv_video243d.lib
opencv_videostab243d.lib
如果是release配置(以后再说,只需要添加上面的debug配置就行了现在),然后,在“配置”下拉框中选择“Release”,照上面的操作,复制下面的库文件名到上方的空白处:
opencv_calib3d243.dll
opencv_contrib243.dll
opencv_core243.dll
opencv_features2d243.dll
opencv_ffmpeg243.dll
opencv_flann243.dll
opencv_gpu243.dll
opencv_highgui243.dll
opencv_imgproc243.dll
opencv_legacy243.dll
opencv_ml243.dll
opencv_nonfree243.dll
opencv_objdetect243.dll
opencv_photo243.dll
opencv_stitching243.dll
opencv_ts243.dll
opencv_video243.dll
opencv_videostab243.dll
(可根据实际需要删减)
到此Opencv2.3.1配置完成,下面编译运行程序。
以下程序来自Opencv中文官方网:
/index.php/%E9%A6%96%E9%A1%B5
稍改动,不编译此句#include "stdafx.h",经笔者测试,不编译此句不会影响结果,编译则出错。
笔者还无法解决此问题,请多指教。
编译运行下面的程序需要将lena.jpg文件放在项目目录下,即与项目文件同一个文件夹。
/***********************************************************************
* OpenCV 2.3.1 测试例程
* 于仕琪提供
***********************************************************************/
//#include "stdafx.h"
#include<opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main(int argc, char* argv[])
{
const char* imagename = "lena.jpg";
//从文件中读入图像
Mat img = imread(imagename);
//如果读入图像失败
if(img.empty())
{
fprintf(stderr, "Can not load image %s\n", imagename);
return -1;
}
//显示图像
imshow("image", img);
//此函数等待按键,按键盘任意键就返回
waitKey();
return 0;
}
运行出现以上结果,说明你的配置完成!在配置过程中要谨慎,稍有差错就无法完成配置,如果配置出错,请认真看准以上的每个操作,再来一遍!对于以上所有配置应理择而不能盲从,只有理解每步操作的用意,才能更好地解决随时出现的问题,使用Opencv这开放平台。
望此对广大爱好者与项目科研人员有所帮助!
5、附录
以上的配置步骤是参与Opencv官方中文网,想学习更多关于Opencv的编程
技术,建议登录Opencv官方中文网。