Morphing & Warping 2D Morphing Involves 2 steps 1.Image warping “get features to line up” 2.Cross-dissolve “mix colors” (fade-in/fadeout transition)

Slides:



Advertisements
Similar presentations
Direct Volume Rendering. What is volume rendering? Accumulate information along 1 dimension line through volume.
Advertisements

03/16/2009Dinesh Manocha, COMP770 Texturing Surface’s texture: its look & feel Graphics: a process that takes a surface and modifies its appearance using.
CSE554Extrinsic DeformationsSlide 1 CSE 554 Lecture 9: Extrinsic Deformations Fall 2012.
CSE554Extrinsic DeformationsSlide 1 CSE 554 Lecture 10: Extrinsic Deformations Fall 2014.
Morphing CSE 590 Computational Photography Tamara Berg.
2-D IMAGE MORPHING.
2D preobrazba (morphing). 2D preobrazba dekle-tiger.
Feature-Based Image Metamorphosis Thaddeus Beier Shawn Neely SIGGRAPH 1992.
A new approach for modeling and rendering existing architectural scenes from a sparse set of still photographs Combines both geometry-based and image.
CSCE 641:Computer Graphics Image Warping/Morphing Jinxiang Chai.
CSCE 641:Computer Graphics Image Warping/Morphing Jinxiang Chai.
Geometric Modeling Surfaces Mortenson Chapter 6 and Angel Chapter 9.
Image Morphing : Rendering and Image Processing Alexei Efros.
Image Morphing Tong-Yee Lee. Image Morphing Animate transitions between two images Specify Correspondence Warping Blending.
Computational Photography Image Warping/Morphing Jinxiang Chai.
1cs426-winter-2008 Notes  Collision notes part 1 (primitive operations) should be up on the weekend.
1 Computer Science 631 Lecture 3: Morphing, Sampling Ramin Zabih Computer Science Department CORNELL UNIVERSITY.
Image Morphing : Computational Photography Alexei Efros, CMU, Fall 2005 © Alexey Tikhonov.
Midterm Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
Image Morphing, Triangulation CSE399b, Spring 07 Computer Vision.
OpenGL Texture Mapping April 16, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Basic Stragegy Three steps to applying a texture.
Image warping/morphing Digital Video Special Effects Fall /10/17 with slides by Y.Y. Chuang,Richard Szeliski, Steve Seitz and Alexei Efros.
Image Morphing, Thin-Plate Spline Model CSE399b, Spring 07 Computer Vision
Computer Animation Algorithms and Techniques
CSE554SimplificationSlide 1 CSE 554 Lecture 7: Simplification Fall 2014.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Image Morphing CSC320: Introduction to Visual Computing
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
COMP 175: Computer Graphics March 24, 2015
MORPHING Presentation By: SWARUP DEEPIKA JAGMOHAN Date: 22 OCT 2002 Course: COMPUTER GRAPHICS.
CSCE 441: Computer Graphics Image Warping/Morphing Jinxiang Chai.
CS 551/651 Advanced Computer Graphics Warping and Morphing Spring 2002.
Geometric Operations and Morphing.
11/11/04© University of Wisconsin, CS559 Fall 2004 Last Time Shading Interpolation Texture mapping –Barycentric coordinates for triangles.
Texture Mapping. Scope Buffers Buffers Various of graphics image Various of graphics image Texture mapping Texture mapping.
Texture Mapping Course: Computer Graphics Presented by Fan Chen
Texture Mapping. 2 Motivation A typical modern graphics card can handle 10s of millions of polygons a second. How many individual blades of grass are.
Computational Photography Derek Hoiem, University of Illinois
OpenGL Texture Mapping. 2 Objectives Introduce the OpenGL texture functions and options.
CS 480/680 Computer Graphics OpenGL Texture Mapping Dr. Frederick C Harris, Jr. Fall 2011.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Image Warping and Morphing cs195g: Computational Photography James Hays, Brown, Spring 2010 © Alexey Tikhonov.
CSE554SimplificationSlide 1 CSE 554 Lecture 7: Simplification Fall 2013.
CSE554Fairing and simplificationSlide 1 CSE 554 Lecture 6: Fairing and Simplification Fall 2012.
Advanced Multimedia Warping & Morphing Tamara Berg.
CS559: Computer Graphics Lecture 8: Warping, Morphing, 3D Transformation Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Image Morphing Computational Photography Derek Hoiem, University of Illinois 9/29/15 Many slides from Alyosha Efros.
Deformation using interpolation CSE 3541 Matt Boggus.
Image warping Li Zhang CS559
Multimedia Programming 10: Image Morphing
CS559: Computer Graphics Lecture 7: Image Warping and Panorama Li Zhang Spring 2008 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Image warping/morphing Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/3/15 with slides by Richard Szeliski, Steve Seitz and Alexei Efros.
Deformation techniques
Image Morphing © Zooface Many slides from Alexei Efros, Berkeley.
2D preobrazba (morphing)
CS1315: Introduction to Media Computation
Image warping/morphing
OpenGL Texture Mapping
Computational Photography Derek Hoiem, University of Illinois
Feature-Based Warping
3D Game Programming Texture Mapping
CSE 554 Lecture 10: Extrinsic Deformations
Morphing WU PO-HUNG.
Filtering Images Work in the spatial domain
Feature-Based Warping
3D Game Programming Texture Mapping
Computer Graphics: Image Warping/Morphing
Image Morphing using mesh warp and feature based warp
Presentation transcript:

Morphing & Warping

2D Morphing Involves 2 steps 1.Image warping “get features to line up” 2.Cross-dissolve “mix colors” (fade-in/fadeout transition) Related to texture mapping and grid deformation –Texture mapping T(u,v) = (x,y,z), mapping specified by u v vertex pairs.

What is texture mapping? Texture mapping T(u,v) = (x,y,z), mapping specified by vertex pairs. How does it work? Uh Oh!!! Interpolation is used. Affine (think Bresenham), or perspective.

Some details (Thanks, Wikipedia!) Affine texture mapping directly interpolates a texture coordinate u a between two endpoints and u 0 and u 1 : u a = (1-a)u 0 + au 1 where 0 ≤ a ≤ 1 A little openGL, if you’re curious glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

2D Morphing G(x,y) = (u2 + v2, uv) (Mapping specified by equation) Lack control for different parts of image F(u,v); (Do we actually want the corners and edges of the image to move???) Grid Deformation

2 pass mesh Warping (Smythe 90) Idea: use splines to specify curves on each image get control of warping Input 1.Source & destination images 2.2D array of control points in source 3.2D array of control pts in destination Source Destination How to code new mesh into a changed image?

To animate S D Need to animate source grid to destination grid to produce intermediate grids I (could be multiple passes) At each animation frame, need to generate intermediate image from S & I * Could use texture mapping, but the problem is we need to interpolate arbitrarily shaped polygons/triangles..

Steps 1.Fit curves through control points (e.g. Catmull-Rom splines) 2.1 st pass: match spans in x & interpolate 3.2 nd pass: match spans in y in intermediate image( from step 2) and interpolate 4.Match image to new grid (or images, if 2) 5.Cross dissolve (morph), if 2 different images Linear blend: Color ij = Δf Color ij D + (1 –Δf) Color ij S (pixel by pixel)

Steps For Each Frame in Animation for 2 different images time 0 n Source image Source grid Intermediate grid Intermediate image 1 Intermediate image 2 Composite image Destination grid Destination image Warp source to grid Warp destination to grid C ij = Δf C ij D + (1 –Δf) C ij S f 01 … …

Magnification and Minification How to smooth out pixels? Filter, e.g. gaussian Averaging source pixels

Feature Based Image Metamorphisis (Beier and Neely, ’92) Instead of using curves, use line-pairs to specify correspondence Instead of 2 pass approach, 1 pass that calculates weighted contributions from each line pair to each pixel Input: –Source image –Destination image –Line pairs PQ S PQ D

Step For each frame between source S & destination D –Interpolate PQ S & PQ D to generate intermediate “destination shape” –Warp S to intermediate destination shape –Warp d to intermediate destination shape –Cross dissolve warped images –Save result as intermediate frame QSQS QIQI QDQD PSPS PIPI PDPD Still some problems (recall linear interpolation) – maybe use quaternion

Field Morphing For a Single Line Pair 1.Given P’Q’ in S, and PQ in D 2.Parameterize length as u:0.. 1 over PQ and scaled over P’Q’ 3.Given some point X, distance v from PQ u = || X-P|| cos Ө/||Q-P|| (% distance from P, along PQ ) v = [(X – P) ┴(Q-P)]/||Q-P|| Where ┴(m) is defined -1/m … e.g. 1/(P-Q) V is the projection of of P-X onto the perpendicular vector V X P Q u v Ө X’ =? P’ Q’ Is there an alternative math technique to get u and v?

Field Morphing For a Single Line Pair X’ = P’ + u (Q’ – P’) + [v┴(Q’-P’)] / ||Q’-P’|| X P Q u v Ө P’ Q’ Scaled u vector Unit vector along ┴ X’

Single Line Pair Ps QsPdQd (30,50) SourceDestination Given the line pairs in the destination and source frames, what is the pixel in the source frame that corresponds to the point (30,50) in the destination frame?

u = (X-P d ) (Q d -P d ) / |Q d -P d | 2 u = (20,-30)(70,0) / 70 2 u = 1400/4900 = 2/7 v = | (X-P d ) x (Q d -P d ) / |Q d -P d | 2 | v =|(20,-30) x (70,0) / 70 2 | note: 2D cross product = determinant v = 2100/4900 = 3/7

T = Q s - P s =(0,70) S = (T y, - T x ) = (70,0) X’ = P s + uT + vS X’ = (10,10) + 2/7 (0,70) + 3/7 (70,0) X’ = (10,10) + (0,20) + (30,0) = (40,30)

Multiple Lines Think Shepard’s algorithm For point X in the source image, we calculate X’ for each of the line pairs Then use a weighted sum to ultimately find the destination X’

The details X’ is calculated from X and a weighted set of distances from X X’ = X +Σ D i W i / ( Σ W i ), n = number of lines D i = X i ’ – X W i = [ length i P / (a+ dist i )] b P =importance to line length. Increasing P increases the effect of longer lines b = how influence falls off with distance (0.5…2). What if b=0? dist i = distance from X to line i; as distance increases, weight decreases a = prevents division by zero, can also help with smoothing the lines themselves i = 1 n n

3D Morphing Place link here

3D Morphing Imagine you have two 3D meshes; how to morph between them? Issues: –Getting a mapping between polygons of the 2 objects –Different numbers of polygons Down sample or increase sampling? Imagine you have two 3D volumes; how to morph between them?

Surface Morphing With Different Numbers of triangles Use simplification (edge collapse techniques) to simplify correspondence –Make sure it is reversible/tracks changes User needs to simplify vertices around features High Resolution, high vertex count Low Resolution, low vertex count Specify points around key features to preserve them

Feature Based Volume Metamorphosis Extension of idea of Beier and Neely Instead of simple line pairs, element pairs Elements have –“dimensionality”: can be a point, line, rectangular plane or volume (box) –spatial configuration: Local coordinate system and origin Scaling factor (features extent along local axes) Beier and Neely method applied to get new mesh (handwaving..)

Another Method: Fourier Volume Mapping Object volume must be described by a function FT: integrate over [function*e -i2πft ] For each time step –Compute FFT of each volume’s function –Compute the weighted sum of the 2 FFTs –Undo the Fourier transform on the result The more “modes”, the closer to the actual function

Pluses and Minuses Resolves correspondence issue (move out of cartesian space into frequency space) A clean process but less than ideal results (better on some shapes than others) No guarantee features will stay where they should

3D Morphing Idea: input triangle mesh with different number of vertices –Use simplification to simplify correspondence problem