image morphing

Download Image Morphing

If you can't read please download the document

Post on 25-Feb-2016

25 views

Category:

Documents

0 download

Embed Size (px)

DESCRIPTION

09/29/11. Image Morphing. Computational Photography Derek Hoiem, University of Illinois. Many slides from Alyosha Efros. Survey. Project 2. Class choice awards Greg Meyer Thapanapong Lin-Ming Honorable mentions Susanne Jihua. Sense of Future Projects (Opinions of Last Class). - PowerPoint PPT Presentation

TRANSCRIPT

Computational Photography CS498dwh

Image MorphingComputational PhotographyDerek Hoiem, University of Illinois

09/29/11Many slides from Alyosha Efros

1SurveyProject 2Class choice awardsGreg MeyerThapanapongLin-Ming

Honorable mentionsSusanneJihua

Sense of Future Projects (Opinions of Last Class)HybridAlignmentGradientMorphingStitchingRatings (1=bad, 5=good)Proj 1Proj 2Proj 3Proj 4Proj 5Interestingness 4.23.94.7 4.7 4.4 Amount Learned4.23.7 4.4 4.6 4.3 Challenge (1=low, 5=high)2.43.1 3.6 3.6 3.8 Recommended (% yes)1008510085852D image transformations

These transformations are a nested set of groups Closed under composition and inverse is a member

Affine: # correspondences?How many DOF?How many correspondences needed for affine?

xxT(x,y)yy?Take-home Question1) Suppose we have two triangles: ABC and ABC. What transformation will map A to A, B to B, and C to C? How can we get the parameters? T(x,y)?ABCACBSourceDestinationTake-home Question2) Show that ratios along a line are preserved under 2d linear transformations.9/23/2010

(x1,y1)(x2,y2)(x3,y3)ooo(x1,y1)(x2,y2)(x3,y3)oooHint: Because x2 is on the line through x1 and x3, x2 = k*(x3-x1)+x1 where k is between 0 and 1 if x2 is between x1 and x3Today: Morphinghttp://youtube.com/watch?v=nUDIoN-_Hxs

Women in arthttp://www.youtube.com/watch?v=L0GKp-uvjO0

AgingExample: warping trianglesGiven two triangles: ABC and ABC in 2D (12 numbers) Need to find transform T to transfer all pixels from one to the other.What kind of transformation is T?How can we compute the transformation matrix:

T(x,y)?ABCACBSourceDestination

warping triangles (Barycentric Coordinaes)Very useful for Project 3 (hint,hint,nudge,nudge)ABCACBSourceDestination(0,0)(1,0)(0,1)changeof basisInverse changeof basisDont forget to move the origin too!

Image warpingGiven a coordinate transform (x,y) = T(x,y) and a source image f(x,y), how do we compute a transformed image g(x,y) = f(T(x,y))?

xxT(x,y)f(x,y)g(x,y)yyf(x,y)g(x,y)Forward warpingSend each pixel f(x,y) to its corresponding location (x,y) = T(x,y) in the second image

xxT(x,y)yyf(x,y)g(x,y)Forward warpingSend each pixel f(x,y) to its corresponding location (x,y) = T(x,y) in the second imagexxT(x,y)Q: what if pixel lands between two pixels?yyA: distribute color among neighboring pixels (x,y)Known as splattingWhat is the problem with this approach? f(x,y)g(x,y)xyInverse warpingGet each pixel g(x,y) from its corresponding location (x,y) = T-1(x,y) in the first image

xxQ: what if pixel comes from between two pixels?yT-1(x,y)f(x,y)g(x,y)xyInverse warpingGet each pixel g(x,y) from its corresponding location (x,y) = T-1(x,y) in the first imagexxT-1(x,y)Q: what if pixel comes from between two pixels?yA: Interpolate color value from neighborsnearest neighbor, bilinear, Gaussian, bicubicCheck out interp2 in MatlabBilinear Interpolation

http://en.wikipedia.org/wiki/Bilinear_interpolationForward vs. inverse warpingQ: which is better?

A: Usually inverseeliminates holeshowever, it requires an invertible warp functionMorphing = Object AveragingThe aim is to find an average between two objectsNot an average of two images of objectsbut an image of the average object!How can we make a smooth transition in time?Do a weighted average over time t

PQv = Q - PP + 0.5v= P + 0.5(Q P)= 0.5P + 0.5 QExtrapolation: t1P + 1.5v= P + 1.5(Q P)= -0.5P + 1.5 Q (t=1.5)Linear InterpolationNew point: (1-t)P + tQ0

View more