Image Warping and Mosacing 15-463: Rendering and Image Processing Alexei Efros …with a lot of slides stolen from Steve Seitz and Rick Szeliski.

Slides:



Advertisements
Similar presentations
CS 691 Computational Photography Instructor: Gianfranco Doretto Image Warping.
Advertisements

More Mosaic Madness : Computational Photography Alexei Efros, CMU, Fall 2011 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen from.
CSCE 641 Computer Graphics: Image Mosaicing Jinxiang Chai.
Mosaics con’t CSE 455, Winter 2010 February 10, 2010.
Lecture 11: Transformations CS4670/5760: Computer Vision Kavita Bala.
Computational Photography: Image Mosaicing Jinxiang Chai.
Announcements Project 2 Out today Sign up for a panorama kit ASAP! –best slots (weekend) go quickly...
Announcements Project 1 artifact voting ( announce later today) Project 2 out today (help session at end of class) IMPORTANT: choose Proj 2 partner.
Lecture 8: Geometric transformations CS4670: Computer Vision Noah Snavely.
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2008 Some slides from Steve Seitz
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2005 Some slides from Steve Seitz
Homographies and Mosaics : Computational Photography Alexei Efros, CMU, Fall 2005 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen.
Lecture 7: Image Alignment and Panoramas CS6670: Computer Vision Noah Snavely What’s inside your fridge?
Lecture 6: Image transformations and alignment CS6670: Computer Vision Noah Snavely.
Lecture 9: Image alignment CS4670: Computer Vision Noah Snavely
Announcements Project 2 out today panorama signup help session at end of class Today mosaic recap blending.
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.
1Jana Kosecka, CS 223b Cylindrical panoramas Cylindrical panoramas with some slides from R. Szeliski, S. Seitz, D. Lowe, A. Efros,
CSCE 641 Computer Graphics: Image Mosaicing Jinxiang Chai.
More Mosaic Madness : Computational Photography Alexei Efros, CMU, Fall 2005 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen from.
Panoramas and Calibration : 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.
More Mosaic Madness : Computational Photography Alexei Efros, CMU, Fall 2006 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen from.
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 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.
Mosaics CSE 455, Winter 2010 February 8, 2010 Neel Joshi, CSE 455, Winter Announcements  The Midterm went out Friday  See to the class.
Image Stitching Ali Farhadi CSE 455
CSC 589 Lecture 22 Image Alignment and least square methods Bei Xiao American University April 13.
Image Warping (Szeliski 3.6.1) cs129: Computational Photography James Hays, Brown, Fall 2012 Slides from Alexei Efros and Steve Seitz
Warping CSE 590 Computational Photography Tamara Berg.
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.
Image stitching Digital Visual Effects Yung-Yu Chuang with slides by Richard Szeliski, Steve Seitz, Matthew Brown and Vaclav Hlavac.
Image Warping and Morphing cs195g: Computational Photography James Hays, Brown, Spring 2010 © Alexey Tikhonov.
Advanced Multimedia Warping & Morphing Tamara Berg.
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.
Digital Image Processing Additional Material : Imaging Geometry 11 September 2006 Digital Image Processing Additional Material : Imaging Geometry 11 September.
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.
Mosaics Today’s Readings Szeliski and Shum paper (sections 1 and 2, skim the rest) –
CS559: Computer Graphics Lecture 7: Image Warping and Panorama Li Zhang Spring 2008 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Lecture 15: Transforms and Alignment CS4670/5670: Computer Vision Kavita Bala.
Image Stitching Computer Vision CS 691E Some slides from Richard Szeliski.
Image Warping 2D Geometric Transformations
Homographies and Mosaics : Computational Photography Alexei Efros, CMU, Fall 2006 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen.
Lecture 10: Image alignment CS4670/5760: Computer Vision Noah Snavely
Image warping/morphing Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/3/15 with slides by Richard Szeliski, Steve Seitz and Alexei Efros.
Prof. Adriana Kovashka University of Pittsburgh October 3, 2016
CS4670 / 5670: Computer Vision Kavita Bala Lecture 20: Panoramas.
More Mosaic Madness © Jeffrey Martin (jeffrey-martin.com)
COSC579: Image Align, Mosaic, Stitch
Lecture 7: Image alignment
RANSAC and mosaic wrap-up
More Mosaic Madness : Computational Photography
Image Stitching Slides from Rick Szeliski, Steve Seitz, Derek Hoiem, Ira Kemelmacher, Ali Farhadi.
More Mosaic Madness © Jeffrey Martin (jeffrey-martin.com)
Recap from Friday Image Completion Synthesis Order Graph Cut Scene Completion.
Idea: projecting images onto a common plane
Announcements Project 2 out today (help session at end of class)
More Mosaic Madness : Computational Photography
2D transformations (a.k.a. warping)
Image Stitching Computer Vision CS 678
Announcements Project 1 Project 2 Vote for your favorite artifacts!
Announcements Project 1 artifact voting Project 2 out today
Image Stitching Linda Shapiro ECE/CSE 576.
Image Stitching Linda Shapiro ECE P 596.
Presentation transcript:

Image Warping and Mosacing : Rendering and Image Processing Alexei Efros …with a lot of slides stolen from Steve Seitz and Rick Szeliski

Today Mosacs Image Warping Homographies Programming Assignment #2 OUT Reading: Paul Heckbert, “Projective Mappings for Image Warping”, 1999 Rick Szeliski, Chapter on Mosaicing from his new book ( ), being written as we speak, hopefully on the web by Monday

Mosaics: stitching images together virtual wide-angle camera

How to do it? Basic Procedure Take a sequence of images from the same position –Rotate the camera about its optical center Compute transformation between second image and first Transform the second image to overlap with the first Blend the two together to create a mosaic If there are more images, repeat …but wait, why should this work at all? What about the 3D geometry of the scene? Why aren’t we using it?

A pencil of rays contains all views real camera synthetic camera Can generate any synthetic camera view as long as it has the same center of projection!

Aligning images Translations are not enough to align the images left on topright on top

mosaic PP Image reprojection The mosaic has a natural interpretation in 3D The images are reprojected onto a common plane The mosaic is formed on this plane Mosaic is a synthetic wide-angle camera

Image reprojection Basic question How to relate two images from the same camera center? –how to map a pixel from PP1 to PP2 PP2 PP1 Answer Cast a ray through each pixel in PP1 Draw the pixel where that ray intersects PP2 But don’t we need to know the geometry of the two planes in respect to the eye? Observation: Rather than thinking of this as a 3D reprojection, think of it as a 2D image warp from one image to another

Image Warping image filtering: change range of image g(x) = h(f(x)) f x h f x f x h f x image warping: change domain of image g(x) = f(h(x))

Image Warping hh f f g g image filtering: change range of image g(x) = h(f(x)) image warping: change domain of image g(x) = f(h(x))

Parametric (global) warping Examples of parametric warps: translation rotation aspect affine perspective cylindrical

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

Recovering warp parameters Given two images and a transformation type, how do we recover the parameters? 1.Search parameters of h() are: Easy for translation: loop through t x and t y But harder with more DOF Minimization, e.g. Newton’s Method 2. Point Correspondences (often user-defined) Click on the same point in two images How many correspondences for: –translation, Euclidean, similarity, affine, projective h I1I1 I2I2

Homography Q: Which t-form is the right one for warping PP1 into PP2? translation, Euclidean, affine, projective A: Projective – mapping between any two PPs with the same center of projection rectangle should map to arbitrary quadrilateral must preserve straight lines same as: project, rotate, reproject called Homography PP2 PP1 Hpp’ To apply a homography H Compute p’ = Hp (regular matrix multiply) Convert p’ from homogeneous to image coordinates

Image warping with homographies image plane in frontimage plane below black area where no pixel maps to

Image rectification To unwarp (rectify) an image solve for homography H given a set of p and p’ pairs solve equations of the form: wp’ = Hp –linear in unknowns: w and coefficients of H –H is defined up to an arbitrary scale factor –how many points are necessary to solve for H? p p’

Solving for homographies Can set scale factor i=1. So, there are 8 unkowns. Set up a system of linear equations: Ah = b where vector of unknowns h = [a,b,c,d,e,f,g,h] T Need at least 8 eqs, but the more the better… Solve for h. If overconstrained, solve using least-squares: Can be done in Matlab using “\” command see “help lmdivide” p’ = Hp

Fun with homographies St.Petersburg photo by A. Tikhonov Virtual camera rotations Original image

Panoramas 1.Pick one image (red) 2.Warp the other images towards it (usually, one by one) 3.blend

changing camera center Does it still work? synthetic PP PP1 PP2

Planar scene (or far away) PP3 is a projection plane of both centers of projection, so we are OK! This is how big areal photographs are made PP1 PP3 PP2

Planar mosaic

Image warping Given a coordinate transform (x’,y’) = h(x,y) and a source image f(x,y), how do we compute a transformed image g(x’,y’) = f(h(x,y))? xx’ h(x,y) f(x,y)g(x’,y’) yy’

f(x,y)g(x’,y’) Forward warping Send each pixel f(x,y) to its corresponding location (x’,y’) = h(x,y) in the second image xx’ h(x,y) Q: what if pixel lands “between” two pixels? yy’

f(x,y)g(x’,y’) Forward warping Send each pixel f(x,y) to its corresponding location (x’,y’) = h(x,y) in the second image xx’ h(x,y) Q: what if pixel lands “between” two pixels? yy’ A: distribute color among neighboring pixels (x’,y’) –Known as “splatting”

f(x,y)g(x’,y’) x y Inverse warping Get each pixel g(x’,y’) from its corresponding location (x,y) = h -1 (x’,y’) in the first image xx’ Q: what if pixel comes from “between” two pixels? y’ h -1 (x,y)

f(x,y)g(x’,y’) x y Inverse warping Get each pixel g(x’,y’) from its corresponding location (x,y) = h -1 (x’,y’) in the first image xx’ h -1 (x,y) Q: what if pixel comes from “between” two pixels? y’ A: resample color value –We discussed resampling techniques before nearest neighbor, bilinear, Gaussian, bicubic

Forward vs. inverse warping Q: which is better? A: usually inverse—eliminates holes however, it requires an invertible warp function—not always possible...

Programming Assignment #2 Homographies and Panoramic Mosaics Capture photographs (and possibly video) can check out cameras and/or tripods from us (1 day loan) Compute homographies (define correspondences) will need to figure out how to setup system of eqs. Warp images (show some nice warps) Produce panoramic mosaics will discuss blending next time Do some of the Bells and Whistles (can be in pairs)

Bells and Whistles Blending and Compositing use homographies to combine images or video and images together in an interesting (fun) way. E.g. –put fake graffiti on buildings or chalk drawings on the ground –replace a road sign with your own poster –project a movie onto a building wall –etc.

Bells and Whistles Automatic stitching Implement automatic (or semi-automatic) stitching there are several methods, probably the easiest is to do cylindrical panoramas. But will need to know focal length and have tripod. Other approaches possible. Talk to me. Can run the algorithm on a video sequence (build a panorama from video)

Bells and Whistles Capture creative/cool/bizzare panoramas, either rotational or planar Example from UW (by Brett Allen): Ever wondered what is happening inside your fridge while you are not looking?

Bells and Whistles Video Panorama Capture two (or more) stationary videos (either from the same point, or of a planar/far-away scene). Compute homography and produce a video mosaic. Need to worry about synchronization (not too hard). e.g. capturing a football game from the sides of the stadium Other interesting ideas? talk to me