




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年同学聚会策划方案
- 2025年第一季渣打香港中小企领先营商指数报告
- 2025年电工收缩带项目可行性研究报告
- 2025年玄米茶项目可行性研究报告
- 2025年牛蹄筋串项目可行性研究报告
- 2025春新版三年级下册科学•必背知识点考点
- 荆楚理工学院《管理统计》2023-2024学年第二学期期末试卷
- 江西工程学院《声乐(2)》2023-2024学年第一学期期末试卷
- 珠海科技学院《体育与生存》2023-2024学年第一学期期末试卷
- 湖南工程学院《英语视听说四》2023-2024学年第二学期期末试卷
- 形势与政策(贵州财经大学)知到智慧树章节答案
- 层流手术室的管理
- 机电安装安全措施方案
- 文化产业股东权益合作协议书
- 中华人民共和国学前教育法-知识培训
- 康复科自查报告及整改措施
- 2024年四川省宜宾市中考英语试题含解析
- 多式联运智慧物流平台构建方案
- 担保公司专项检查方案
- 景区旅游安全风险评估报告
- 二级建造师《矿业工程管理与实务》试题(100题)
评论
0/150
提交评论