基于球面全景图的三维实景制作.docx
《基于球面全景图的三维实景制作.docx》由会员分享,可在线阅读,更多相关《基于球面全景图的三维实景制作.docx(11页珍藏版)》请在冰点文库上搜索。
基于球面全景图的三维实景制作
基于球面全景图的三维实景制作
摘要:
三维实景也叫虚拟现实(VirtualReality)全景,是基于序列图片的数字三维全景技术。
它使用专门的鱼眼镜头拍摄序列真实图片,经过拼接融合生成球面全景图。
本文结合三维全景制作相关流程,探讨了与之相关的理论与关键技术,形成了一整套全景影像获取、拼接、发布技术流程,最后与**大学档案馆的数字化建设相结合,介绍了三维全景系统的关键制作步骤。
关键词:
虚拟现实图像拼接图像融合球面全景图
Abstract:
Three-dimensionalvirtualrealityisalsocalledtheVirtualReality,it’sadigitalthree-dimensionalpanoramictechnologybasedonsequenceimages.Itusesspecializedfish-eyelenstoshootsequencesofrealpictures,throughthefusionsplicinggeneratesasphericalpanorama.Inthispaper,basedonthree-dimensionalpanoramicproductionrelatedprocessesdiscussedtheassociatedtheoriesandkeytechnologies,formedacompletesetofpanoramicimaginggets,splicing,publicationtechnologyprocess,finallycombinedwiththedigitalconstructionof**UniversityArchives, introducedthekey stepsintheproductionof three-dimensional panoramasystem.
Keywords:
VirtualrealityImagestitchingImagematchingSphericalPanoramicImage
1引言
广义上的全景就是视角范围超过人的正常视角的图像,本文我们说的全景特指水平视角360°,垂直视角180°的图像。
360°全景最大的三个特点是:
1、全:
全方位,用户可观看左右360°,上下180°球型范围内的所有景致;
2、景:
实景,在现场采集的一系列照片基础上经过拼接合成得到的最大限度的保留了场景真实性的全景照片;
3、360°:
360°环视的效果,虽然照片都是平面的,但是通过软件处理之后得到的360°实景,却能给人以三维立体的空间感觉,使观者犹如身在其中。
由于它给人们带来全新的真实现场感和交互式的感受,故可广泛应用于三维电子商务,如在线的房地产楼盘展示、虚拟旅游、虚拟教育、医疗、航空等领域。
在地质勘测、军事侦察、医学微创手术、航空航天以及视频会议等多个领域都发挥着重要作用。
1Introduction
Panoramainabroadsenseistheimage’perspectivebeyondthenormal,panoramicofthisarticlewesayespeciallyahorizontalangleof360°,180°verticalperspectiveimage.Threelargestfeaturesofthe360°panoramaare:
1.Entire:
Omni-directional,userscanwatcharound360°,180°sphericalrangeupanddownallofthelandscape;
2.Scenery:
Outdoorscene,panoramabased on aseriesofphotos collected andthrough themosaic synthesis hasretained theauthenticityofthescene;
3.360°:
Theeffectof360°lookaround,althoughthepicturesareflat,butthe360°virtualwhenprocessedthroughthesoftwarewillbringapersonwiththree-dimensionalfeeling,justliketheViewerisinit.
2三维全景关键技术
2Thekeytechnologyofthree-dimensionalpanorama
2.1Thegeneralprocessof panoramageneration
2.1全景图生成一般流程
本文系统在基于IBR方法基础上,先利用数码相机+鱼眼镜头采集场景序列图片,然后把多幅全景图投影到合适的空间模型,本文采用的是球面投影模型,再把拼接处理过的全景图组织成虚拟的全景空间,用户通过场景中导航图标可以在这个虚拟空间进行前进、后退、转弯、切换场景等漫游;每个场景都可以进行360°环视、变焦浏览等操作。
综上所述,基于全景图技术的虚拟场景生成过程可以用图2.1表示。
Thesysteminthispaperis basedontheIBRmethod, andusethe digitalcamerawith fisheyelens acquisition sequenceofscenes,Thenputanumberofimagesprojectedontotheappropriatespacemodelofpanoramicimage,weusethesphericalprojectionmodelthispaper,Thentreatedstitchingpanoramaorganizedintovirtualpanoramicspace,Usersnavigatethroughthescenarioiconcanbeforward,backward,turn,switchscenesroaminginthisvirtualspace;Eachscenecanbe360degreesaround,zoombrowsingoperationsetc.Insummary,virtualscenegenerationprocessbasedonpanoramatechnologycanberepresentedbyFigure2.1
图2.1全景图生成流程图
Figure2.1Flowchartofpanoramasgenerate
2.2全景图像采集
全景图像的拍摄要求360°无死角的视角角度,所以对全景设备有着较高的要求,总体来说在图像的采集过程中要求有以下几点[1]:
1、拍摄角度要恰当,相机应大致位于一个场景的中心位置。
2、拍摄水平角度图像时,要尽可能的避免平转数码相机时镜头的偏斜和俯仰,尽量保持相机水平旋转。
3、相机要尽可能的绕光心旋转。
偏离光心引入的误差会导致插值图像时的重影和定位困难。
4、拍摄时光圈和焦距要固定不变。
不同的光圈会使拍摄的不同方向的照片亮度、对比度和色彩差异较大。
5、同一场景的序列图像必须有重叠部分,一般重叠区域约为30%-50%之间,这样拼接图像的时候才有足够的匹配点。
6、同一场景的采集时间要尽快,间隔不要太久,以免风云变色,带来外界环境变化,影响拼接效果。
7、在拍摄时,场景中尽量不要出现移动的物体。
2.2Panoramicimageacquisition
Panorama shootingrequires 360° nodeadangleof view, thereforehasahigherrequest tothe panoramicequipment,Ingeneral theimageacquisitionprocess requirements areasfollows[1]:
Thecameraangletobeappropriate,thecamerashouldberoughlylocatedinthecenterofascene.
Whenshooting Horizontalangleimage, toavoidasmuchaspossible deviation andpitchwhenthedigitalcamerapan, andtryto keepthecamera rotation.
Rotationaroundtheopticalcenterofthecameraasmuchaspossible.Error introducedbydeviatingfromtheopticalcenterwillcauseinterpolationimageghostinganddifficulttolocate.
Whenshooting,apertureandfocallengthtobefixed.Differentaperturewouldmakephotosofthedifferentdirectionofbrightness,contrastandcolorquitedifferent.
Sequence imagesofthesamescene must haveoverlappingparts.Generaloverlapareaapproximately30%to50%,sowhenstitchingimageshaveenoughmatchingpoints.
Acquisitiontimeofthesamesceneassoonaspossible,nottoolongintervals,inordertoavoidthesituationdiscoloration,bringingtheexternalenvironmentchangesthataffectsplicingeffect.
Infilming,trynottoappearmovingobjectinthescene.
球面全景空间的视点空间对应单一视点处的球面范围,要获取该范围内的实景图,需要固定照相机或摄像机的位置,平转照相机或摄像机,每旋转一定的角度,拍摄一张照片[2],完成水平360°景象的拍摄后,需要将相机从最初的水平位置向上翻转90°,使镜头朝上拍一张此场景天空的照片。
但是由于拍摄天空时的镜头比拍摄水平方向时的镜头要高,所以要把相机往下调一点。
完成对天空的拍摄后,再将三脚架向后移动一定距离,把相机向下旋转到最大角度(大约75°左右)拍一张地的照片,这样就完成了一个场景的360°拍摄。
拍摄实景图像使用的器材包括三脚架、水平仪和数码相机等。
如图2.2所示。
Viewspaceinsphericalpanoramicspacecorrespondingtothesingle viewpoint ofSpherical range, togetthe realmap intherange, youneedfixed cameraor cameraposition,swing thecamera,rotates acertainangle, takeaphoto[2],Completethe level 360degree scene shooting, thecameraneedsto be turnedup90degrees fromtheoriginal horizontalposition, makethelensupwardtoshootskyofthisscene.However,duetothelenswhenshootingtheskyhigherthanshootinghorizontal,soputthecamera down abit.Aftercompletingtheshoottothesky,andthenmovingthetripodbackwardatadistance,putthecameradowntoitsmaximumangle(about75°orso)totakeaphotoofearth,thiscompletes asceneof 360° shooting.Shootingrealimagesusingequipmentincludestripods,levelsanddigitalcameras,etc.AsshowninFigure2.2.
图2.2拍摄实景图像装置图
Figure2.2Diagramofapparatustotakenrealimages
2.3球面投影
球面全景图的投影是将鱼眼照片上的点映射到球面模型上(如图2.3所示),所有的投影线都是与球面垂直的,所以没有如传统平面图像中的光轴[3]。
因此,只要在球面视图中可见,空间中的每个点都能在球面投影中展示出来。
2.3Sphericalprojection
Sphericalpanoramaprojectionistomapthepointsonthefisheyephotostosphericalmodel(asshowninfigure2.3),Allprojectionlinesareperpendiculartothesphere's,sothereisnoopticalaxisliketraditionplaneimage[3].Therefore,aslongasvisibleinthesphericalview,eachpointinthespacecanbedisplayedinthestereographicprojection.
图2.3球面变换示意
Figure2.3sphericaltransformindication
如图2.3所示,相机位于半径为f的球体中心,相机的拍摄方向即投影的方向由极角θ(相机视线与相机坐标系Z轴的夹角)和方位角φ(相机视线在相机坐标系中XY平面内的投影与X轴的夹角)决定。
在球面投影中,相机坐标系与球面坐标系是一样的。
假设P在世界坐标系中的坐标为:
(1)
P在球面上的投影点p的球面坐标可以表示为:
(2)
推导出:
(3)
这里
。
由此,可以通过该公式算出照片上任意点P在投影球面的对应点p的坐标。
2.3.1而我等均为地哦我去
山东龙口就爱死爹我
Asshowninfigure2.3,thecameraislocatedinthecenterofaspherewitharadiusoff,CamerashootingdirectionthatisprojectiondirectionisdeterminedbythepolarAngleθ(TheanglebetweenthecameralineofsightandCameracoordinatesystemzaxis)andazimuthAngleφ(TheanglebetweenthecameralineofsightinthecameracoordinatesystemXYplaneandtheXaxis).Insphericalprojection,thecameracoordinatesystemandthesphericalcoordinatesystemisthesame.AssumethatthecoordinatesofPintheworldcoordinatesystemis:
(1)
ThesphericalcoordinatesoftheprojectionpointpofPcanbeexpressedas:
(2)
Canbededuced:
(3)
Here
.
Thus,thecoordinatesofany pointP’corresponds Pinprojection surfaceCanbecalculatedbytheformula.
2.4全景图拼接
简单地说,图像拼接就是把采集到的一些有相互重叠区域的图像序列变成一副无缝的360°全景图。
对于由于经济原因而采用非全视角相机拍摄的图片来说,图像的拼接是构建360°虚拟全景空间的一个重要步骤,拼接质量的好坏,决定了能否给用户一个逼真的、真实的浏览效果。
一般来说,图像拼接的误差应小于一个像素。
由于拍摄到的相邻的图片之间存在一定区域的重叠,如图2.4所示,可以以此为拼接方法的入手点,用拼接工具识别出相邻图片的重叠区域,从而达到生成全景图的目的。
为了达到让人满意的拼接效果,重叠区域大小要适当,对于图像特征明显的图片,重叠区域可以小一些,反之,就要大一些。
一般情况下,相邻两幅图像的重叠部分应该在30%—50%之间。
2.4Panoramastitching
Inbrief,imagestitchingistoputsequenceofoverlappingimagesintoaseamless360°panoramas.Imageswhichforeconomicreasonthatusenon-full-viewcamerashoot,imagestitchingisanimportantsteptobuild360°virtualpanoramaspace,stitching quality, decideswhether togiveusersarealisticandauthenticview.Ingeneral,imagestitchingerrorshouldbelessthanonepixel.Becauseofthereisacertainareaofoverlapbetweenadjacentimages,asshowninfigure2.4,wecantakethisasastartingpointofstitchingmethod,withsplicingtooltoidentifytheoverlapofadjacentimages,soastoachievethepurposeofgeneratingpanorama.Inordertoachievesatisfactorysplicingeffect,overlappingregionsizeshouldbeappropriate,forImageswhichhavesignificantfeature,overlappingareacanbesmaller,conversely,willgreatly.Ingeneral,theoverlapbetweentwoimagesshouldbebetween30%-50%.
图2.4全景图拼接示意图
2.5图像融合
对图像进行匹配之后,只是完成了对图像的定位。
如果这时只根据拼接算法求得的两幅图像上下和水平方向的平移参数将两幅图简单的叠加起来,由于相邻图像之间存在的亮度差异和拍摄时三脚架旋转对拍摄图像带来的影响等原因,就会出现合成的图像有清晰的边界,拼接痕迹明显等让我们不能接受的现象。
而图像融合[4]就是在图像匹配之后对图像像素值进行处理,目的是在保证图像的质量不发生改变的前提下消除图像拼接后出现的拼接痕迹。
2.5ImageFusion
Aftertheimagematching,justcompletedthepositioningoftheimage.Atthistime,ifyousimplyoverlaytwoimagestogetheronlyaccordingtoverticalandhorizontaltranslationalparameters obtained bystitchingalgorithm,Duetobrightnessdifferencesexistbetweenadjacentimagesandeffectsofrotationonatripodwhenshootingimagesandotherreasons,therewillbe thesyntheticimageshave clearboundaries, obvioussplicingtraces,whichweobviouslycannotacceptphenomenon.
Imagefusionistoprocessingimagepixelsafterimagematching,objectiveistoremovingsplicingtracesunderthepremiseofguaranteethequalityoftheimagedoesnotchange.
3应用实例
本节将结合相关理论和算法实现一个全景图漫游系统,本系统是××大学校史馆的三维全景漫游系统。
为广大校友提供了一个足不出户便可身临其境的浏览母校历史的平台。
系统中对关键图片和文字配有多边形热区,用户通过点击想要细致阅读查看的区域,即可弹出相应的放大图片或相关视频文件。
不仅方便了用户查看,更增加了系统的生动性和真实感。
系统主界面如图所示:
3Applicationexamples
Thissectionwillcombinerel