Image Warping / Morphing

Slides:



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

Morphing CSE 590 Computational Photography Tamara Berg.
Lecture 11: Transformations CS4670/5760: Computer Vision Kavita Bala.
CSCE 641:Computer Graphics Image Warping/Morphing Jinxiang Chai.
Lecture 8: Geometric transformations CS4670: Computer Vision Noah Snavely.
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2005 Some slides from Steve Seitz
CSCE 641:Computer Graphics Image Warping/Morphing Jinxiang Chai.
Image Morphing : Rendering and Image Processing Alexei Efros.
Computational Photography Image Warping/Morphing Jinxiang Chai.
Lecture 9: Image alignment CS4670: Computer Vision Noah Snavely
Announcements Project 1 artifact voting Project 2 out today panorama signup help session at end of class Guest lectures next week: Li Zhang, Jiwon Kim.
Image Morphing : Computational Photography Alexei Efros, CMU, Fall 2005 © Alexey Tikhonov.
Image Warping and Mosacing : Rendering and Image Processing Alexei Efros …with a lot of slides stolen from Steve Seitz and Rick Szeliski.
Announcements Project 1 Grading session this afternoon Artifacts due Friday (voting TBA) Project 2 out (online) Signup for panorama kits ASAP (weekend.
Image Morphing, Triangulation CSE399b, Spring 07 Computer Vision.
Announcements Project 1 artifact voting Project 2 out today (help session at end of class)
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
Image Warping Computational Photography Derek Hoiem, University of Illinois 09/27/11 Many slides from Alyosha Efros + Steve Seitz Photo by Sean Carroll.
Announcements Midterm due Friday, beginning of lecture Guest lecture on Friday: Antonio Criminisi, Microsoft Research.
Image Stitching Ali Farhadi CSE 455
Image Morphing CSC320: Introduction to Visual Computing
Image Warping (Szeliski 3.6.1) cs129: Computational Photography James Hays, Brown, Fall 2012 Slides from Alexei Efros and Steve Seitz
CSCE 441: Computer Graphics Image Warping/Morphing Jinxiang Chai.
Warping CSE 590 Computational Photography Tamara Berg.
Cartographic Applications
Geometric Operations and Morphing.
Image Warping Computational Photography Derek Hoiem, University of Illinois 09/23/10 Many slides from Alyosha Efros + Steve Seitz Photo by Sean Carroll.
Mosaics Today’s Readings Szeliski, Ch 5.1, 8.1 StreetView.
Computational Photography Derek Hoiem, University of Illinois
Image Morphing Computational Photography Derek Hoiem, University of Illinois 10/02/12 Many slides from Alyosha Efros.
Image Warping and Morphing cs195g: Computational Photography James Hays, Brown, Spring 2010 © Alexey Tikhonov.
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.
Image Morphing ( Computational Photography) Jehee Lee Seoul National University With a lot of slides stolen from Alexei Efros and Seungyong Lee.
Mosaics part 3 CSE 455, Winter 2010 February 12, 2010.
Image Morphing Computational Photography Derek Hoiem, University of Illinois 9/29/15 Many slides from Alyosha Efros.
Image warping Li Zhang CS559
Image Warping and Morphing : Computational Photography Alexei Efros, CMU, Fall 2011 © Alexey Tikhonov.
Image Warping and Morphing © Alexey Tikhonov CS194: Image Manipulation & Computational Photography Alexei Efros, UC Berkeley, Fall 2015.
Multimedia Programming 10: Image Morphing
Image Warping Many slides from Alyosha Efros + Steve Seitz + Derek oeim Photo by Sean Carroll.
Example: warping triangles Given two triangles: ABC and A’B’C’ in 2D (12 numbers) Need to find transform T to transfer all pixels from one to the other.
CS559: Computer Graphics Lecture 7: Image Warping and Panorama Li Zhang Spring 2008 Most slides borrowed from Yungyu ChuangYungyu Chuang.
CS559: Computer Graphics Lecture 7: Image Warping and Morphing Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Lecture 15: Transforms and Alignment CS4670/5670: Computer Vision Kavita Bala.
Image Warping 2D Geometric Transformations
Lecture 10: Image alignment CS4670/5760: Computer Vision Noah Snavely
Brent M. Dingle, Ph.D Game Design and Development Program Mathematics, Statistics and Computer Science University of Wisconsin - Stout Warps, Filters,
Image warping/morphing Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/3/15 with slides by Richard Szeliski, Steve Seitz and Alexei Efros.
Image Morphing © Zooface Many slides from Alexei Efros, Berkeley.
Jeremy Bolton, PhD Assistant Teaching Professor
Image warping/morphing
COSC579: Image Align, Mosaic, Stitch
Computational Photography Derek Hoiem, University of Illinois
Computational Photography Derek Hoiem, University of Illinois
Lecture 7: Image alignment
Image Warping and Morphing
Image warping/morphing
Image Stitching Slides from Rick Szeliski, Steve Seitz, Derek Hoiem, Ira Kemelmacher, Ali Farhadi.
Recap from Friday Image Completion Synthesis Order Graph Cut Scene Completion.
Lecture 3: Camera Rotations and Homographies
Announcements Project 2 out today (help session at end of class)
2D transformations (a.k.a. warping)
Image Stitching Computer Vision CS 678
Morphing WU PO-HUNG.
Image Stitching Linda Shapiro ECE/CSE 576.
Computer Graphics: Image Warping/Morphing
Image Stitching Linda Shapiro ECE P 596.
Presentation transcript:

Image Warping / Morphing [Wolberg 1996, Recent Advances in Image Morphing] Computational Photography Connelly Barnes Some slides from Fredo Durand, Bill Freeman, James Hays

Morphing Video: Women in Art http://www.vimeo.com/1456037

Terminator 2 Morphing (1991) Terminator 2 Clip (YouTube)

Image Warping in Biology D'Arcy Thompson Importance of shape and structure in evolution http://en.wikipedia.org/wiki/D'Arcy_Thompson Slide by Durand and Freeman

Cambrian Explosion Source: http://www.earthlearningidea.com/

Skeletons

Skeletons

Recovering Transformations ? T(x,y) y y’ x x’ f(x,y) g(x’,y’) What if we know f and g and want to recover the transform T? e.g. better align photographs you’ve taken willing to let user provide correspondences How many do we need?

Translation: # correspondences? T(x,y) y y’ x x’ How many correspondences needed for translation? How many Degrees of Freedom? What is the transformation matrix?

Translation + Rotation? T(x,y) y y’ x x’ How many correspondences needed for translation+rotation? How many DOF?

Affine: # correspondences? T(x,y) y y’ x x’ How many correspondences needed for affine transform? How many DOF?

Projective / Homography ? T(x,y) y y’ x x’ How many correspondences needed for projective? How many DOF?

Image Warping T(x,y) y y’ x x’ f(x,y) g(x’,y’) Given 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))?

Forward warping Send each pixel (x,y) to its corresponding location T(x,y) y y’ x x’ (x,y) (x’,y’) Send each pixel (x,y) to its corresponding location (x’,y’) = T(x,y) in the second image

Forward warping Q: what if pixel lands “between” two pixels? T(x,y) y y’ x x’ f(x,y) g(x’,y’) Q: what if pixel lands “between” two pixels? A: distribute color among neighboring pixels (x’,y’) Known as “splatting” Can also interpolate points in target image: griddata (Matlab), scipy.interpolate.griddata (Python)

Inverse warping T-1(x,y) y y’ x x x’ (x,y) (x’,y’) Get each pixel color g(x’,y’) from its corresponding location (x,y) = T-1(x’,y’) in the first image

Inverse warping Q: what if pixel comes from “between” two pixels? T-1(x,y) y y’ x x x’ f(x,y) g(x’,y’) Q: what if pixel comes from “between” two pixels? A: Interpolate color value from neighbors nearest neighbor, bilinear, Gaussian, bicubic See interp2 (Matlab), scipy.interpolate.interp2d (Python)

Forward vs. inverse warping Q: Which is better?

Forward vs. inverse warping Q: Which is better? A: Usually inverse – eliminates holes However, it requires an invertible warp function Not always possible

How to Obtain Warp Field? Move control points to specify a spline warp Spline produces a smooth vector field T(x, y) Slide Alyosha Efros

Warp as Interpolation We are looking for a warping field A function that given a 2D point, returns a warped 2D point We have a sparse number of correspondences These specify values of the warping field This is an interpolation problem Given sparse data, find smooth function

Interpolation in 1D We are looking for a function f We have N data points: xi, yi Scattered: spacing between xi is non-uniform We want f so that For each i, f(xi)=yi f is smooth Depending on notion of smoothness, different f

Radial Basis Functions (RBF) Place a smooth kernel R centered on each data point xi

Radial Basis Functions (RBF) Place a smooth kernel R centered on each data point xi Find weights i to make sure we interpolate the data for each i, f(xi)=yi

Radial Basis Function Kernels Linear Cubic Quintic Thin plate Inverse Multiquadratic

Solve RBF Interpolation Problem For each j, In 1D: N equations, N unknowns, linear solver. In n-D: Denote ai, xi, yi Solve Nm equations in Nm unknowns ai.

RBF Summary Interpolates “scattered data”, or data defined only at a few sparse locations. Basis functions have infinite extent… Python: scipy.interpolate.Rbf MATLAB: Google “matlab rbf interpolation” (3rd party code)

Applying a warp: use inverse Forward warp: For each pixel in input image Paste color to warped location in output Problem: gaps Inverse warp For each pixel in output image Lookup color from inverse-warped location

Example

Example Fold problems Oh well…

1D equivalent of folds No guarantee that our 1D RBF is monotonic input result (remember, inverse warp)

Aliasing Issues with Warping Aliasing can happen if warps are extreme. This is especially noticeable during animation. point sampling mipmaps & linear interpolation

Aliasing Solution Use an ellipsoidal Gaussian: “Elliptical Weighted Average” (EWA) Filter is deformed based on warping. For inverse warping, each output (warped) pixel does a weighted average of nearby pixels against the filter. Can approximate with circular Gaussian. Paul Heckbert Master’s Thesis

Morphing = Object Averaging The aim is to find “an average” between two objects Not an average of two images of objects… …but an image of the average object! How can we make a smooth transition in time? Do a “weighted average” over time t How do we know what the average object looks like? We haven’t a clue! But we can often fake something reasonable Usually required user/artist input

Linear Interpolation P Q v = Q - P How can we linearly transition between point P and point Q? v = Q - P P P + t v = (1-t)P + tQ, e.g. t = 0.5 P and Q can be anything: points on a plane (2D) or in space (3D) Colors in RGB or HSV (3D) Whole images (m-by-n D)… etc.

Idea #1: Cross-Dissolve Interpolate whole images: Imagehalfway = (1-t)*Image1 + t*image2 This is called cross-dissolve in film industry But what if the images are not aligned?

Idea #2: Align, then cross-disolve Align first, then cross-dissolve Alignment using global warp – picture still valid

Full Morphing A B What if there is no simple global function that aligns two images? User specifies corresponding feature points Construct warp animations A -> B and B -> A Cross dissolve these

Full Morphing

Full Morphing Image B Image A 1. Find warping fields from user constraints (points or lines): Warp field TAB(x, y) that maps A pixel to B pixel Warp field TBA(x, y) that maps B pixel to A pixel 2. Make video A(t) that warps A over time to the shape of B Start warp field at identity and linearly interpolate to TBA Construct video B(t) that warps B over time to shape of A 3. Cross dissolve these two videos.

Cross Dissolve: (1-t)A(t) + tB(t) Full Morphing A Warped Image A: A(t) Cross Dissolve: (1-t)A(t) + tB(t) Warped Image B: B(t) B

Catman!

Conclusion Illustrates general principle in graphics: Avoids ghosting First register, then blend Avoids ghosting Michael Jackson - Black or White