CS 445 / 645 Introduction to Computer GraphicsAssignment 3 - MorphingWays to morphBeier-Neely MorphingSlide 5Step 1 – Interpolate endpointsHow would start image morph?Build Common Coordinate SystemSlide 9Find ProjectionSample color from initial imageRepeat for all pixels in imageNow do the same thing for the final imageNow do a 50/50 blend of two warped imagesFinal MovieExtra factors…More than one lineWeighting of multiple pointsSlide 19Solving the Lighting ProblemOptical IllusionLightingSlide 23DefinitionsSlide 25Slide 26Components of IlluminationSlide 28CS 445 / 645Introduction to Computer GraphicsLecture 14Lecture 14Assign 3Assign 3Lecture 14Lecture 14Assign 3Assign 3Assignment 3 - MorphingWhat is morphing?What is morphing?•Combination of warping and blendingCombination of warping and blending–warp = image distortionwarp = image distortionMap image to a coke canMap image to a coke canRipple effectRipple effect–blend = cross dissolveblend = cross dissolveFilm cut effectFilm cut effectWhat is morphing?What is morphing?•Combination of warping and blendingCombination of warping and blending–warp = image distortionwarp = image distortionMap image to a coke canMap image to a coke canRipple effectRipple effect–blend = cross dissolveblend = cross dissolveFilm cut effectFilm cut effectWays to morph3D Techniques3D Techniques•Interpolate between corresponding verticesInterpolate between corresponding vertices–Models must align somehowModels must align somehow–Polygon transformations may look oddPolygon transformations may look odd2D Techniques2D Techniques•Cross-dissolveCross-dissolve–Difficult to alignDifficult to align•Pixelize the images and move the “tiles”Pixelize the images and move the “tiles”–Tile paths must be determined somehowTile paths must be determined somehow3D Techniques3D Techniques•Interpolate between corresponding verticesInterpolate between corresponding vertices–Models must align somehowModels must align somehow–Polygon transformations may look oddPolygon transformations may look odd2D Techniques2D Techniques•Cross-dissolveCross-dissolve–Difficult to alignDifficult to align•Pixelize the images and move the “tiles”Pixelize the images and move the “tiles”–Tile paths must be determined somehowTile paths must be determined somehowBeier-Neely MorphingSimple / effective morphingSimple / effective morphing•User identifies key features with line segmentsUser identifies key features with line segments•Everything else is automaticEverything else is automaticSimple / effective morphingSimple / effective morphing•User identifies key features with line segmentsUser identifies key features with line segments•Everything else is automaticEverything else is automaticAssignment 3 - MorphingHow do we explain this?How do we explain this?How do we explain this?How do we explain this?Step 1 – Interpolate endpointsInterpolate between lines SInterpolate between lines S11SS22 and F and F11FF22 Interpolate between lines SInterpolate between lines S11SS22 and F and F11FF22 S1S2F1F2(0,0)(0,0)½ S1+ ½ F1I1How would start image morph?What is color from start image at X in intermediate image?What is color from start image at X in intermediate image?What is color from start image at X in intermediate image?What is color from start image at X in intermediate image?S1S2F1F2(0,0)(0,0)I1I2XXXXBuild Common Coordinate SystemFind projectionFind projectionFind projectionFind projectionS1S2F1F2(0,0)(0,0)I1I2Xu = (X – I1).dot.(I2 – I1) / ||( I2 – I1) ||uBuild Common Coordinate SystemFind projection on perpendicularFind projection on perpendicularFind projection on perpendicularFind projection on perpendicularS1S2F1F2(0,0)(0,0)I1I2Xv = (X – I1).dot.Perp(I2 – I1) || (I2 – I1) ||vFind ProjectionSample color from initial imageS1S2F1F2(0,0)(0,0)I1I2X=(u,v)X’=(u,v)Repeat for all pixels in imageS1S2F1F2(0,0)(0,0)I1I2uNow do the same thing for the final imageS1S2F1F2(0,0)(0,0)I1I2Now do a 50/50 blend of two warped imagesFinal MovieExtra factors…What about more than one line?What about more than one line?What about more than one line?What about more than one line?S1S2F1F2(0,0)(0,0)I1I2S3S4F3F4I3I4More than one lineCompute pixel color from initial image for each line and average (weighted)Compute pixel color from initial image for each line and average (weighted)Compute pixel color from initial image for each line and average (weighted)Compute pixel color from initial image for each line and average (weighted)S1S2F1F2(0,0)(0,0)I1I2S3S4F3F4I3I4Weighting of multiple pointsA point’s weightA point’s weight•Should be strongest on the line and weaker as moved awayShould be strongest on the line and weaker as moved away•length = length of linelength = length of line–Longer lines have more influenceLonger lines have more influence•dist = distance from pixel to linedist = distance from pixel to lineA point’s weightA point’s weight•Should be strongest on the line and weaker as moved awayShould be strongest on the line and weaker as moved away•length = length of linelength = length of line–Longer lines have more influenceLonger lines have more influence•dist = distance from pixel to linedist = distance from pixel to lineweight Ãlengthpa dist!bweight Ãlengthpa dist!bMore than one lineSolving the Lighting Problem•We somewhat understand the perception of light (color)We somewhat understand the perception of light (color)•We engineered a solution to representing and generating We engineered a solution to representing and generating color using computerscolor using computers•We need to understand the interplay of light and objectsWe need to understand the interplay of light and objects•We somewhat understand the perception of light (color)We somewhat understand the perception of light (color)•We engineered a solution to representing and generating We engineered a solution to representing and generating color using computerscolor using computers•We need to understand the interplay of light and objectsWe need to understand the interplay of light and objectsOptical IllusionLightingRemember, we know how to Remember, we know how to rasterizerasterize•Given a 3-D triangle and a 3-D viewpoint, we know which Given a 3-D triangle and a 3-D viewpoint, we know which pixels represent the trianglepixels represent the triangleBut what
View Full Document