




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Imagewarping/morphingDigitalVisualEffectsYung-YuChuangwithslidesbyRichardSzeliski,SteveSeitz,TomFunkhouserandAlexeiEfrosImagewarpingImageformationABSamplingandquantizationWhatisanimageWecanthinkofanimageasafunction,f:R2
R:f(x,y)givestheintensityatposition(x,y)definedoverarectangle,withafiniterange:f:[a,b]x[c,d]
[0,1]AcolorimagexyfAdigitalimageWeusuallyoperateondigital(discrete)
images:Samplethe2DspaceonaregulargridQuantizeeachsample(roundtonearestinteger)IfoursamplesareDapart,wecanwritethisas:
f[i,j]=Quantize{f(iD,jD)}TheimagecannowberepresentedasamatrixofintegervaluesImagewarpingimagefiltering:changerangeofimageg(x)=h(f(x))fxhgxfxhgximagewarping:changedomainofimageg(x)=f(h(x))h(y)=0.5y+0.5h(y)=2yImagewarpinghhffggimagefiltering:changerangeofimageg(x)=h(f(x))imagewarping:changedomainofimageg(x)=f(h(x))h(y)=0.5y+0.5h([x,y])=[x,y/2]Parametric(global)warpingtranslationrotationaspectaffineperspectivecylindricalExamplesofparametricwarps:Parametric(global)warpingTransformationTisacoordinate-changingmachine:p’=T(p)WhatdoesitmeanthatTisglobal?Isthesameforanypointpcanbedescribedbyjustafewnumbers(parameters)RepresentTasamatrix:p’=M*pTp=(x,y)p’=(x’,y’)ScalingScalingacoordinatemeansmultiplyingeachofitscomponentsbyascalarUniformscalingmeansthisscalaristhesameforallcomponents:
2fgNon-uniformscaling:differentscalarspercomponent:Scalingx2,
y
0.5ScalingScalingoperation:Or,inmatrixform:scalingmatrixSWhat’sinverseofS?2-DRotationThisiseasytocaptureinmatrixform:Eventhoughsin(q)andcos(q)arenonlineartoq,x’isalinearcombinationofxandyy’isalinearcombinationofxandyWhatistheinversetransformation?Rotationby–qForrotationmatrices,det(R)=1soR2x2MatricesWhattypesoftransformationscanbe
representedwitha2x2matrix?2DIdentity?2DScalearound(0,0)?2x2MatricesWhattypesoftransformationscanbe
representedwitha2x2matrix?2DRotatearound(0,0)?2DShear?2x2MatricesWhattypesoftransformationscanbe
representedwitha2x2matrix?2DMirroraboutYaxis?2DMirrorover(0,0)?All2DLinearTransformationsLineartransformationsarecombinationsof…Scale,Rotation,Shear,andMirrorPropertiesoflineartransformations:OriginmapstooriginLinesmaptolinesParallellinesremainparallelRatiosarepreservedClosedundercomposition2x2MatricesWhattypesoftransformationscannotbe
representedwitha2x2matrix?2DTranslation?Onlylinear2Dtransformationscanberepresentedwitha2x2matrixNO!TranslationExampleoftranslationtx=2
ty
=1HomogeneousCoordinatesAffineTransformationsAffinetransformationsarecombinationsof…Lineartransformations,andTranslationsPropertiesofaffinetransformations:OrigindoesnotnecessarilymaptooriginLinesmaptolinesParallellinesremainparallelRatiosarepreservedClosedundercompositionModelschangeofbasisProjectiveTransformationsProjectivetransformations…Affinetransformations,andProjectivewarpsPropertiesofprojectivetransformations:OrigindoesnotnecessarilymaptooriginLinesmaptolinesParallellinesdonotnecessarilyremainparallelRatiosarenotpreservedClosedundercompositionModelschangeofbasisImagewarpingGivenacoordinatetransformx’
=T(x)andasourceimageI(x),howdowecomputeatransformedimageI’(x’)
=
I(T(x))?I(x)I’(x’)xx’T(x)ForwardwarpingSendeachpixelI(x)toitscorrespondinglocationx’
=
T(x)inI’(x’)I(x)I’(x’)xx’T(x)Forwardwarpingfwarp(I,I’,T){for(y=0;y<I.height;y++)for(x=0;x<I.width;x++){(x’,y’)=T(x,y);I’(x’,y’)=I(x,y);}}II’xx’TForwardwarpingSomedestinationmaynotbecoveredManysourcepixelscouldmaptothesamedestinationForwardwarpingSendeachpixelI(x)toitscorrespondinglocationx’
=
T(x)inI’(x’)f(x)g(x’)xx’h(x)Whatifpixellands“between”twopixels?Willbethereholes?Answer:add“contribution”toseveralpixels,normalizelater(splatting)Forwardwarpingfwarp(I,I’,T){for(y=0;y<I.height;y++)for(x=0;x<I.width;x++){(x’,y’)=T(x,y);
Splatting(I’,x’,y’,I(x,y),kernel);}}II’xx’TInversewarpingGeteachpixelI’(x’)fromitscorrespondinglocationx
=
T-1(x’)inI(x)I(x)I’(x’)xx’T-1(x’)Inversewarpingiwarp(I,I’,T){for(y=0;y<I’.height;y++)for(x=0;x<I’.width;x++){(x,y)=T-1(x’,y’);I’(x’,y’)=I(x,y);}}II’xx’T-1InversewarpingGeteachpixelI’(x’)fromitscorrespondinglocationx
=
T-1(x’)inI(x)Whatifpixelcomesfrom“between”twopixels?Answer:resamplecolorvaluefrominterpolated(prefiltered)sourceimagef(x)g(x’)xx’Inversewarpingiwarp(I,I’,T){for(y=0;y<I’.height;y++)for(x=0;x<I’.width;x++){(x,y)=T-1(x’,y’);
I’(x’,y’)=Reconstruct(I,x,y,kernel);}}II’xx’T-1InversewarpingNohole,butmustresampleWhatvalueshouldyoutakefornon-integercoordinate?Closestone?InversewarpingItcouldcausealiasingReconstructionReconstructiongeneratesanapproximationtotheoriginalfunction.Erroriscalledaliasing.samplepositionsamplevaluesamplingreconstructionReconstructionComputedweightedsumofpixelneighborhood;outputisweightedaverageofinput,whereweightsarenormalizedvaluesoffilterkernelkwidthdcolor=0;weights=0;forallq’sdist<widthd=dist(p,q);w=kernel(d);color+=w*q.color;weights+=w;p.Color=color/weights;
pqTrianglefilterGaussianfilterSamplingbandlimitedReconstructionThereconstructedfunctionisobtainedbyinterpolatingamongthesamplesinsomemannerReconstruction(interpolation)Possiblereconstructionfilters(kernels):nearestneighborbilinearbicubicsinc(optimalreconstruction)Bilinearinterpolation(trianglefilter)AsimplemethodforresamplingimagesNon-parametricimagewarpingSpecifyamoredetailedwarpfunctionSplines,meshes,opticalflow(per-pixelmotion)Non-parametricimagewarpingMappingsimpliedbycorrespondencesInversewarpingP’?Non-parametricimagewarpingP’BarycentriccoordinatePBarycentriccoordinatesNon-parametricimagewarpingBarycentriccoordinateNon-parametricimagewarpingradialbasisfunctionGaussianthinplatesplineImagewarpingWarpingisausefuloperationformosaics,videomatching,viewinterpolationandsoon.Anapplicationofimagewarping:
facebeautificationData-drivenfacialbeautificationFacialbeautificationFacialbeautificationFacialbeautificationTrainingsetFaceimages92youngCaucasianfemale33youngCaucasianmaleFeatureextractionFeatureextractionExtract84featurepointsbyBTSMDelaunaytriangulation->234Ddistancevector(normalizedbythesquarerootoffacearea)BTSMscatterplotforalltrainingfaces234DvectorBeautificationengineSupportvectorregression(SVR)SimilarconcepttoSVM,butforregressionRBFkernelsfb(v)BeautificationprocessGiventhenormalizeddistancevectorv,generateanearbyvectorv’sothatfb(v’)>fb(v)TwooptionsKNN-basedSVR-basedKNN-basedbeautification4.34.55.13.14.65.3vv'SVR-basedbeautificationDirectlyusefbtoseekv’Usestandardno-derivativedirectionsetmethodforminimizationFeatureswerereducedto35DbyPCASVR-basedbeautificationProblems:itsometimesyieldsdistancevectorscorrespondingtoinvalidhumanfaceSolution:addlog-likelihoodterm(LP)LPisapproximatedbymodelingfacespaceasamultivariateGaussiandistributionu’sprojectioninPCAspace’si-thcomponenti-theigenvaluePCAλ1λ2EmbeddingandwarpingDistanceembeddingConvertmodifieddistancevectorv’toanewfacelandmarkAgraphdrawingproblemreferredtoasastressminimizationproblem,solvedbyLMalgorithmfornon-linearminimization1ifiandjbelongtodifferentfacialfeatures10otherwiseDistanceembeddingPostprocessingtoenforcesimilaritytransformforfeaturesoneyesbyminimizingOriginalK=3K=5SVRResults(intrainingset)UserstudyResults(notintrainingset)BypartsfullmoutheyesDifferentdegrees50%100%FacialcollageImagemorphingImagemorphingThegoalistosynthesizeafluidtransformationfromoneimagetoanother.image#1image#2dissolvingCrossdissolvingisacommontransitionbetweencuts,butitisnotgoodformorphingbecauseoftheghostingeffects.Artifactsofcross-dissolving/ImagemorphingWhyghosting?Morphing=warping+cross-dissolvingshape(geometric)color(photometric)morphingcross-dissolvingImagemorphingimage#1image#2warpwarpMorphingsequenceFaceaveragingbymorphingaveragefacesImagemorphingcreateamorphingsequence:foreachtimetCreateanintermediatewarpingfield(byinterpolation)WarpbothimagestowardsitCross-dissolvethecolorsinthenewlywarpedimagest=0t=1t=0.33Anidealexample(in2004)t=0t=1t=0.25t=0.5t=0.75morphingAnidealexamplemiddleface(t=0.5)t=0t=1Warpspecification(meshwarping)Howcanwespecifythewarp?1.Specifycorrespondingsplinecontrolpointsinterpolatetoacompletewarpingfunctioneasytoimplement,butlessexpressiveWarpspecificationHowcanwespecifythewarp2.SpecifycorrespondingpointsinterpolatetoacompletewarpingfunctionSolution:converttomeshwarpingDefineatriangularmeshoverthepointsSamemeshinbothimages!Nowwehavetriangle-to-trianglecorrespondencesWarpeachtriangleseparatelyfromsourcetodestinationHowdowewarpatriangle?3points=affinewarp!JustliketexturemappingWarpspecification(fieldwarping)Howcanwespecifythewarp?SpecifycorrespondingvectorsinterpolatetoacompletewarpingfunctionTheBeier&NeelyAlgorithm
Beier&Neely(SIGGRAPH1992)Singleline-pairPQtoP’Q’:Algorithm(singleline-pair)ForeachXinthedestinationimage:Findthecorrespondingu,vFindX’inthesourceimageforthatu,vdestinationImage(X)=sourceImage(X’)Examples:AffinetransformationMultipleLineslength=lengthofthelinesegment,dist=distancetolinesegmentTheinfluenceofa,p,b.ThesameastheaverageofXi’FullAlgorithmResultingwarpComparisontomeshmorphingPros:moreexpressiveCons:speedandcontrolWarpinterpolationHowdowecreateanintermediatewarpattimet?li
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 班级小组合作学习的设计计划
- 工艺美术在学校的重要性计划
- 推动班级环保意识的活动计划
- 数理思维提升能力计划
- 社团活动中的创意应用计划
- 激发学生学习兴趣的教学活动设计计划
- 特种设备安全管理标准计划
- 财务政策制定流程计划
- 供应链协同的实施方法试题及答案
- 2024年陪诊师考试最佳策略试题及答案
- 城镇燃气安全技术与管理
- 初级会计实务全书电子教案
- 2025年安徽安徽省合肥汽车客运有限公司招聘笔试参考题库含答案解析
- 安徽省 2025 年九年级中考历史模拟试卷二(含答案)
- 武汉市部分学校2024-2025学年下学期3月考七年级数学试题(含答案)
- 2024-2030全球动态细胞分析行业调研及趋势分析报告
- 2025年临床试验数据保密协议
- 湖南中烟工业有限责任公司招聘考试真题2024
- 《X射线管原理与应用》课件
- 2024年湖北省襄阳市第四中学第五中学自主招生考试语文试卷
- 七年级下册《二元一次方程组》课件与练习
评论
0/150
提交评论