Opencv库的应用Word格式.docx

上传人:b****8 文档编号:22457089 上传时间:2023-02-04 格式:DOCX 页数:27 大小:350.90KB
下载 相关 举报
Opencv库的应用Word格式.docx_第1页
第1页 / 共27页
Opencv库的应用Word格式.docx_第2页
第2页 / 共27页
Opencv库的应用Word格式.docx_第3页
第3页 / 共27页
Opencv库的应用Word格式.docx_第4页
第4页 / 共27页
Opencv库的应用Word格式.docx_第5页
第5页 / 共27页
点击查看更多>>
下载资源
资源描述

Opencv库的应用Word格式.docx

《Opencv库的应用Word格式.docx》由会员分享,可在线阅读,更多相关《Opencv库的应用Word格式.docx(27页珍藏版)》请在冰豆网上搜索。

Opencv库的应用Word格式.docx

题目类型:

理论研究实验研究工程设计工程技术研究软件开发应用研究

摘要

大多数计算机科学家和程序员已经意识到计算机视觉的重要作用。

但是很少有人知道计算机视觉的所有应用。

例如,大多数人或多或少地知道计算机视觉可用在监控方面,也知道视觉被越来越多地用在网络图像和视频方面。

少数人也了解计算机视觉在游戏界面方面的应用。

但是很少有人了解大多数航空和街道地图图像(如Google的StreetView)也大量使用计算机定标和图像拼接技术。

一些人知道安全监控、无人飞行器或生物医学分析等方面的应用,但是很少人知道机器视觉是多么广泛地被用在工厂中:

差不多所有的大规模制造的产品都在流水线上的某个环节上自动使用视觉检测。

OpenCV诞生于Intel研究中心,其目的是为了促进CPU密集型应用。

为了达到这一目的,Intel启动了多个项目,包括实时光线追踪和三维显示墙。

一个在Intel工作的OpenCV作者在访问一些大学时,注意到许多顶尖大学中的研究组(如MIT媒体实验室)拥有很好的内部使用的开放计算机视觉库--(在学生们之间互相传播的代码),这会帮助一个新生从高的起点开始他/她的计算机视觉研究。

这样一个新生可以在以前的基础上继续开始研究,而不用从底层写基本函数。

因此,OpenCV的目的是开发一个普遍可用的计算机视觉库。

在Intel的性能库团队的帮助下,OpenCV实现了一些核心代码以及算法,并发给Intel俄罗斯的库团队。

这就是OpenCV的诞生之地:

在与软件性能库团队的合作下,它开始于Intel的研究中心,并在俄罗斯得到实现和优化。

俄罗斯团队的主要负责人是VadimPisarevsky,他负责管理项目、写代码并优化OpenCV的大部分代码,在OpenCV中很大一部分功劳都属于他。

跟他一起,VictorEruhimov帮助开发了早期的架构,ValeryKuriakin管理俄罗斯实验室并提供了很大的支持。

在开始时,OpenCV有以下三大目标。

为基本的视觉应用提供开放且优化的源代码,以促进视觉研究的发展。

能有效地避免"

闭门造车"

通过提供一个通用的架构来传播视觉知识,开发者可以在这个架构上继续开展工作,所以代码应该是非常易读的且可改写。

本库采用的协议不要求商业产品继续开放代码,这使得可移植的、性能被优化的代码可以自由获取,可以促进基于视觉的商业应用的发展。

这些目标说明了OpenCV的缘起。

计算机视觉应用的发展会增加对快速处理器的需求。

与单独销售软件相比,促进处理器的升级会为Intel带来更多收入。

这也许是为什么这个开放且免费的库出现在一家硬件生产企业中,而不是在一家软件公司中。

从某种程度上说,在一家硬件公司里,在软件方面会有更多创新的空间。

OpenCV所有的开放源代码协议允许你使用OpenCV的全部代码或者OpenCV的部分代码生成商业产品。

使用了OpenCV后,你不必对公众开放自己的源代码或改善后的算法,虽然我们非常希望你能够开放源代码。

许多公司(IBM,Microsoft,Intel,SONY,Siemens和Google等其他公司)和研究单位(例如斯坦福大学、MIT、CMU、剑桥大学和INRIA)中的人都广泛使用OpenCV,其部分原因是OpenCV采用了这个宽松的协议。

Yahoogroups里有一个OpenCV论坛(000个会员。

OpenCV在全世界广受欢迎,在中国、日本、俄罗斯、欧洲和以色列都有庞大的用户群。

自从OpenCV在1999年1月发布alpha版本开始,它就被广泛用在许多应用领域、产品和研究成果中。

相关应用包括卫星地图和电子地图的拼接,扫描图像的对齐,医学图像去噪(消噪或滤波),图像中的物体分析,安全和入侵检测系统,自动监视和安全系统,制造业中的产品质量检测系统,摄像机标定,军事应用,无人飞行器,无人汽车和无人水下机器人。

将视觉识别技术用在声谱图上,OpenCV可以进行声音和音乐识别。

在斯坦福大学的Stanley机器人项目中,OpenCV是其视觉系统的关键部分。

Stanley在DARPA机器人沙漠挑战赛中,赢得了二百万美元奖金。

OpenCV的目标是为解决计算机视觉问题提供基本工具。

在有些情况下,它提供的高层函数可以高效地解决计算机视觉中的一些很复杂的问题。

当没有高层函数时,它提供的基本函数足够为大多数计算机视觉问题创建一个完整的解决方案。

对于后者,有几个经过检验且可靠的使用OpenCV的方法;

所有这些方法都是首先大量使用OpenCV函数来解决问题。

一旦设计出解决方案的第一个版本,便会了解它的不足,然后可以使用自己的代码和知识来解决(更为广知的一点是"

解决实际遇到的问题,而不是你想像出来的问题"

)。

你可以使用第一个版本的解决方案作为一个基准,用之评价解决方案的改进程度。

解决方案所存在的不足可以通过系统所用的环境限制来解决。

关键字:

OpenCV;

算法;

视觉;

系统

Abstract

Mostcomputerscientistsandprogrammershaverealizedtheimportantroleofcomputervision.Butfewpeopleknowallapplicationsofcomputervision.Forexample,mostpeoplemoreorlessknowthatcomputervisioncanbeusedinmonitoring,alsoknowthatvisionhasbeenincreasinglyusedinnetworkimageandvideo.Afewpeoplealsounderstandtheapplicationsofcomputervisioninthegameinterface.ButfewpeopleknowmostairlinesandStreetmapimage(suchasGoogle'

sStreetView)isalsoextensiveuseofcomputercalibrationandimagematchingtechnology.Someknowsecuritymonitoring,unmannedaerialvehicles,ortheapplicationofbiomedicalanalysis,butfewknowhowmachinevisioniswidelyusedinthefactory:

aretheproductsmadeinalmostallofthemassontheassemblylineofacertainlinkautomaticallyusingvisualinspection.

OpenCV,wasbornatIntelresearchcenter,itspurposeistopromotetheCPUintensiveapplications.Inordertoachievethisgoal,Intellaunchedmultipleprojects,includingreal-timeraytracingand3ddisplaywall.AworkinIntelOpenCVauthorduringavisittosomeuniversity,notedthatmanyofthetopuniversitiesintheteam(e.g.,MITmedialab)tohavegoodinternaluseofopencomputervisionlibrary-(thecode)tospreadeachotherbetweenthestudents,itwillhelpanewstudentfromahighstartingpointofhis/hercomputervisionresearch.Suchafreshmancanonthebasisofthepreviouscontinuetoresearch,insteadoffromthebottomtowritebasicfunction.

OpenCV,therefore,thepurposeistodevelopageneralcomputervisionofavailablelibraries.Intheteam,withthehelpoftheperformanceoftheIntelOpenCVimplementssomecorecodeandalgorithm,andgivenaIntelteamofRussia.ThisisthebirthplaceofOpenCV:

underthecooperationwithsoftwareteam'

sperformance,itbeginswithIntel'

sresearchcentre,andimplementedinRussiaandoptimization.

Themajorpersons-in-chargeoftheRussianteamisVadimPisarevsky,heisresponsibleformanagingtheproject,writingcodeandoptimizeOpenCVmostofthecode,alargepartofthecreditintheOpenCVbelongtohim.Togetherwithhim,VictorEruhimovhelpstodeveloptheearlyarchitecture,ValeryKuriakinRussiamanagementoflaboratoryandprovidesgreatsupport.Inthebeginning,OpenCVhasthefollowingthreegoals.

Toprovidebasicvisualapplicationopenandoptimizationofthesourcecode,topromotethedevelopmentofvisionresearch.Caneffectivelyavoidthe"

closed"

.

Byprovidingacommonframeworktospreadknowledgevision,developerscancontinuetoworkonthisarchitecture,sothecodeshouldbeveryeasytoreadandcanbechanged.

ThislibraryUSEStheagreementdoesnotrequirecommercialproductscontinuetoopenthecode,whichmakestheportable,performancecanbeoptimizedcodefreeaccess,canpromotethedevelopmentofcommercialapplicationbasedonvision.

ThesegoalsillustratestheoriginofOpenCV.Thedevelopmentofcomputervisionapplicationwillincreasethedemandforfastprocessor.Comparedwithsinglesellingsoftware,andpromotetheupgradewillbringmorerevenuefortheIntelprocessor.Thisisperhapswhytheopenandfreelibraryappearsinahardwaremanufacturingenterprise,ratherthaninasoftwarecompany.Tosomeextent,inahardwarecompany,therewillbemoreinnovativespaceintermsofsoftware.

&

nbsp;

OpenCVallopensourceagreementallowsyoutouseallthecodeorOpenCVOpenCVpartofthecodegenerationofcommercialproducts.AfterusingtheOpenCV,youdon'

thavetobeopentothepublic'

sownsourcecodeortheimprovedalgorithm,thoughwereallyhopeyoucanopenthesourcecode.Manycompanies(IBM,Microsoft,Intel,SONY,Siemens,andGoogleandothercompanies)andresearchunit(forexample,MIT,Stanforduniversity,CMU,universityofCambridgeandtheINRIA)arewidelyusedintheOpenCV,partofthereasonisOpenCVadoptedtheeasyagreement.YahoogroupsinaOpenCVBBS(userscanpostquestionshereanddiscussed;

TheBBSabout20,000members.OpenCVispopularallovertheworld,inChina,Japan,Russia,EuropeandIsraelhasalargeusergroup.

SincetheOpenCVinJanuary1999alphaversion,itiswidelyusedinmanyapplications,products,andinresearch.Relatedapplicationsincludesatellitemapandelectronicmapofstitching,scanimagealignment,medicalimagedenoising(orfilter)denoising,imageoftheobjectanalysis,securityandintrusiondetectionsystem,automaticmonitoringandsecuritysystems,manufacturingofproductsqualityinspectionsystem,cameracalibration,militaryapplications,unmannedaerialvehicles,unmannedvehiclesandunmannedunderwaterrobot.Thevisualidentificationtechnologyinthespectrogram,OpenCVcanbeusedtoidentifythesoundandmusic.AtStanforduniversity'

sStanleyrobotproject,OpenCVisthekeypartofthevisualsystem.StanleyinDARPArobotdesertchallenge,wona$twomillionbonus.

OpenCV'

sgoalistosolvetheproblemofcomputervisiontoprovidebasictools.Insomecases,itcanprovideahigh-levelfunctionefficientlysolvesomecomplexproblemsincomputervision.Whenthereisnohigh-levelfunction,itprovidesthebasicfunctionisenoughformostofthecomputervisionproblemstocreateacompletesolution.Inthelattercase,thereareseveralprovenandreliabletouseOpenCVmethod;

AllofthesemethodsarethefirstextensiveuseofOpenCVfunctiontosolvetheproblem.Oncethedesignsolutionforthefirstversion,willknowitisnotenough,youcanthenuseyourowncodeandknowledgetosolve(morewidelyknownpointis"

tosolvepracticalproblems,ratherthanyouimaginedproblem"

).Youcanusethefirstversionofthesolutionasabenchmark,intheevaluationofdegreeofimprovementsolution.Ofthedefectsinthesolutioncanbeusedbythesystemtosolvetheenvironmentallimitation.

Keywords:

OpenCV;

Thealgorithm;

Visual;

system

目录

1实验目的与任务1

1.1了解OPENCV的算法1

1.2了解OPENCV的一般应用方法。

1

2OpenCV1

2.1Opencv简介1

2.2主要应用范围2

3调试optical_flow_demo.cpp3

3.1程序4

3.2逻辑、实现过程以及作用7

4OpenCV应用8

4.2程序分析9

4.2程序分析16

5实验总结16

1实验目的与任务

1.1了解OPENCV的算法

2OpenCV

2.1Opencv简介

OpenCV是开源的计算机视觉库,自1999以来由英特尔开发。

写在C/C++;

包含超过500个函数,可以在Windows,Linux和MacOSX运行。

到目前为止被广泛使用在许多公司和研究中心。

OpenCV提供的视觉处理算法非常丰富,并且它部分以C语言编写,加上其开源的特性,处理得当,不需要添加新的外部支持也可以完整的编译链接生成执行程序,所以很多人用它来做算法的移植,OpenCV的代码经过适当改写可以正常的运行在DSP系统和单片机系统中,这种移植在大学中经常作为相关专业本科生毕业设计或者研究生课题的选题。

2.2主要应用范围

OpenCV结构中包含CV:

图像处理和视觉算法,HighGUI:

图像和视频的I/O,CXCORE:

持XML的基本结构和算法,绘制功能。

HighGUI可以创建窗口;

对图像的I/O进行渲染;

处理按键、超时以及其它事件;

以及对跟踪条,鼠标回调视频I/O进行处理。

cxcore提供了大量的绘图功能,包括:

线,圆,椭圆,椭圆弧,填充多边形或多边形轮廓,文本(使用一个嵌入式字体),一切可绘制不同的颜色,不同的线宽度,反走样的开/关,支持任意类型的图像。

应用领域:

人机互动,物体识别,图象分割,人脸识别,动作识别,运动跟踪,机器人,运动分析,机器视觉,结构分析。

对相关程序test进行分析,代码如下:

运行过后生成图片1。

1.#include<

cxcore.h>

2.#include<

highgui.h>

3.#include<

math.h>

4.intmain(intargc,char**argv){

5.CvPointcenter;

6.doublescale=-3;

7.IplImage*image=argc==2?

cvLoadImage(argv[1]):

0;

8.if(!

image)return-1;

9.center=cvPoint(image->

width/2,image->

height/2);

10.for(inti=0;

i<

image->

height;

i++)

11.for(intj=0;

j<

width;

j++){

12.doubledx=(double)(j-center.x)/center.x;

13.doubledy=(double)(i-center.y)/center.y;

14.doubleweight=exp((dx*dx+dy*dy)*scale);

15.uchar*ptr=&

CV_IMAGE_ELEM(image,uchar,i,j*3);

16.ptr[0]=cvRound(ptr[0]*weight);

17.ptr[1]=cvRound(ptr[1]*weight)

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 医学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1