Image Stitching Computer Vision CS 691E Some slides from Richard Szeliski.

Slides:



Advertisements
Similar presentations
RANSAC and mosaic wrap-up cs195g: Computational Photography James Hays, Brown, Spring 2010 © Jeffrey Martin (jeffrey-martin.com) most slides from Steve.
Advertisements

Photo Stitching Panoramas from Multiple Images Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/28/12.
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.
Image Stitching.
Computational Photography: Image Mosaicing Jinxiang Chai.
Lecture 14: Panoramas CS4670: Computer Vision Noah Snavely What’s inside your fridge?
Announcements Project 2 Out today Sign up for a panorama kit ASAP! –best slots (weekend) go quickly...
Image Processing and Morphing Vision for Graphics CSE 590SS, Winter 2001 Richard Szeliski.
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.
Direct Methods for Visual Scene Reconstruction Paper by Richard Szeliski & Sing Bing Kang Presented by Kristin Branson November 7, 2002.
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 11: Structure from motion CS6670: Computer Vision Noah Snavely.
Lecture 9: Image alignment CS4670: Computer Vision Noah Snavely
Image Stitching and Panoramas
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.
Optical Flow Estimation
Lecture 8: Image Alignment and RANSAC
More Mosaic Madness : Computational Photography Alexei Efros, CMU, Fall 2005 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen from.
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.
More Mosaic Madness : Computational Photography Alexei Efros, CMU, Fall 2006 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen from.
Image Stitching II Ali Farhadi CSE 455
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 Stitching Ali Farhadi CSEP 576 Several slides from Rick Szeliski, Steve Seitz, Derek Hoiem, and Ira Kemelmacher.
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
Image Stitching Richard SzeliskiImage Stitching2 1.Align the images over each other – camera pan ↔ translation on cylinder 2.Blend the images together.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
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 Stitching Ali Farhadi CSE 576 Several slides from Rick Szeliski, Steve Seitz, Derek Hoiem, and Ira Kemelmacher.
CS4670 / 5670: Computer Vision KavitaBala Lecture 17: Panoramas.
Mosaics part 3 CSE 455, Winter 2010 February 12, 2010.
Computer Vision – Sampling Hanyang University Jong-Il Park.
Image Stitching II Linda Shapiro CSE 455. RANSAC for Homography Initial Matched Points.
Mosaics Today’s Readings Szeliski and Shum paper (sections 1 and 2, skim the rest) –
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
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/morphing Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/3/15 with slides by Richard Szeliski, Steve Seitz and Alexei Efros.
Image Stitching II Linda Shapiro EE/CSE 576.
CS4670 / 5670: Computer Vision Kavita Bala Lecture 20: Panoramas.
Image warping/morphing
COSC579: Image Align, Mosaic, Stitch
Lecture 7: Image alignment
RANSAC and mosaic wrap-up
Image Stitching Slides from Rick Szeliski, Steve Seitz, Derek Hoiem, Ira Kemelmacher, Ali Farhadi.
Idea: projecting images onto a common plane
Announcements Project 2 out today (help session at end of class)
More Mosaic Madness : Computational Photography
Image Stitching II Linda Shapiro EE/CSE 576.
Image Stitching II Linda Shapiro CSE 455.
Image Stitching Computer Vision CS 678
CSE 576 (Spring 2005): Computer Vision
Announcements Project 1 Project 2 Vote for your favorite artifacts!
Announcements Project 1 artifact voting Project 2 out today
Image Stitching II Linda Shapiro EE/CSE 576.
Image Stitching Linda Shapiro ECE/CSE 576.
Image Stitching II Linda Shapiro ECE P 596.
Image Stitching Linda Shapiro ECE P 596.
Presentation transcript:

Image Stitching Computer Vision CS 691E Some slides from Richard Szeliski

Richard SzeliskiImage Stitching2 Panoramic Image Mosaics Full screen panoramas (cubic): Mars: New Years Eve:

Richard SzeliskiImage Stitching3 Gigapixel panoramas & images Mapping / Tourism / WWT Medical Imaging

Richard SzeliskiImage Stitching4 Image Mosaics + + … += Goal: Stitch together several images into a seamless composite

Richard SzeliskiImage Stitching5 Today’s lecture Image alignment and stitching motion models image warping point-based alignment complete mosaics (global alignment)

Motion models

Richard SzeliskiImage Stitching7 Motion models What happens when we take two images with a camera and try to align them? translation? rotation? scale? affine? Perspective?

Image Warping

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

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

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

Richard SzeliskiImage Stitching12 2D coordinate transformations translation:x’ = x + t x = (x,y) rotation:x’ = R x + t similarity:x’ = s R x + t affine:x’ = A x + t perspective:x’  H x x = (x,y,1) (x is a homogeneous coordinate) These all form a nested group (closed w/ inv.)

Richard SzeliskiImage Stitching13 Image Warping Given a coordinate transform x’ = h(x) and a source image f(x), how do we compute a transformed image g(x’) = f(h(x))? f(x)f(x)g(x’) xx’ h(x)h(x)

Richard SzeliskiImage Stitching14 Forward Warping Send each pixel f(x) to its corresponding location x’ = h(x) in g(x’) f(x)f(x)g(x’) xx’ h(x)h(x) What if pixel lands “between” two pixels?

Richard SzeliskiImage Stitching15 Forward Warping Send each pixel f(x) to its corresponding location x’ = h(x) in g(x’) f(x)f(x)g(x’) xx’ h(x)h(x) What if pixel lands “between” two pixels? Answer: add “contribution” to several pixels, normalize later (splatting)

Richard SzeliskiImage Stitching16 Inverse Warping Get each pixel g(x’) from its corresponding location x’ = h(x) in f(x) f(x)f(x)g(x’) xx’ h(x)h(x) What if pixel comes from “between” two pixels?

Richard SzeliskiImage Stitching17 Inverse Warping Get each pixel g(x’) from its corresponding location x’ = h(x) in f(x) What if pixel comes from “between” two pixels? Answer: resample color value from interpolated (prefiltered) source image f(x)f(x)g(x’) xx’

Richard SzeliskiImage Stitching18 Interpolation Possible interpolation filters: nearest neighbor bilinear bicubic (interpolating) sinc / FIR Needed to prevent “jaggies” and “texture crawl”

Motion models (reprise)

Richard SzeliskiImage Stitching20 Motion models Translation 2 unknowns Affine 6 unknowns Perspective 8 unknowns 3D rotation 3 unknowns

Richard SzeliskiImage Stitching21 Plane perspective mosaics 8-parameter generalization of affine motion –works for pure rotation or planar surfaces Limitations: –local minima –slow convergence –difficult to control interactively

Richard SzeliskiImage Stitching22 Image warping with homographies image plane in frontimage plane below

Image Mosaics (Stitching) [Szeliski & Shum, SIGGRAPH’97] [Szeliski, FnT CVCG, 2006]

Richard SzeliskiImage Stitching24 Image Mosaics (stitching) Blend together several overlapping images into one seamless mosaic (composite) + + … +=

Richard SzeliskiImage Stitching25 Mosaics for Video Coding Convert masked images into a background sprite for content-based coding =

Richard SzeliskiImage Stitching26 Establishing correspondences 1.Direct method: Use generalization of affine motion model [Szeliski & Shum ’97] 2.Feature-based method Extract features, match, find consisten inliers [Lowe ICCV’99; Schmid ICCV’98, Brown&Lowe ICCV’2003] Compute R from correspondences (absolute orientation)

Richard SzeliskiImage Stitching27 Panoramas What if you want a 360  field of view? mosaic Projection Cylinder

Richard SzeliskiImage Stitching28 Cylindrical panoramas Steps Reproject each image onto a cylinder Blend Output the resulting mosaic

Richard SzeliskiImage Stitching29 f = 180 (pixels) Cylindrical Panoramas Map image to cylindrical or spherical coordinates need known focal length Image 384x300f = 380f = 280

Richard SzeliskiImage Stitching30 Image Stitching 1.Align the images over each other camera pan ↔ translation on cylinder 2.Blend the images together

Richard SzeliskiImage Stitching31 image stitching 1.Take pictures on a tripod (or handheld) 2.Warp images to spherical coordinates 3.Extract features 4.Align neighboring pairs using RANSAC 5.Write out list of neighboring translations 6.Correct for drift 7.Read in warped images and blend them 8.Crop the result and import into a viewer

Richard SzeliskiImage Stitching32 Matching features What do we do about the “bad” matches?

Richard SzeliskiImage Stitching33 RAndom SAmple Consensus Select one match, count inliers

Richard SzeliskiImage Stitching34 RAndom SAmple Consensus Select one match, count inliers

Richard SzeliskiImage Stitching35 Least squares fit Find “average” translation vector

Richard SzeliskiImage Stitching36 Assembling the panorama Stitch pairs together, blend, then crop

Richard SzeliskiImage Stitching37 Problem: Drift Error accumulation small (vertical) errors accumulate over time apply correction so that sum = 0 (for 360° pan.)

Full-view (360° spherical) panoramas

Richard SzeliskiImage Stitching39 Full-view Panorama

Richard SzeliskiImage Stitching40 Texture Mapped Model

Richard SzeliskiImage Stitching41 Global alignment Register all pairwise overlapping images Use a 3D rotation model (one R per image) Use direct alignment (patch centers) or feature based Infer overlaps based on previous matches (incremental) Optionally discover which images overlap other images using feature selection (RANSAC)

Image Blending

Richard SzeliskiImage Stitching43 Image feathering Weight each image proportional to its distance from the edge (distance map [Danielsson, CVGIP 1980] 1. Generate weight map for each image 2. Sum up all of the weights and divide by sum: weights sum up to 1: w i ’ = w i / ( ∑ i w i )

Richard SzeliskiImage Stitching44 Image Feathering

Richard SzeliskiImage Stitching45 Feathering =

Richard SzeliskiImage Stitching46 Effect of window size 0 1 left right 0 1

Richard SzeliskiImage Stitching47 Effect of window size

Richard SzeliskiImage Stitching48 Good window size 0 1 “Optimal” window: smooth but not ghosted Doesn’t always work...

Richard SzeliskiImage Stitching49 Pyramid Blending Burt, P. J. and Adelson, E. H., A multiresolution spline with applications to image mosaics, ACM Transactions on Graphics, 42(4), October 1983, A multiresolution spline with applications to image mosaics

Richard SzeliskiImage Stitching50 Laplacian level 4 Laplacian level 2 Laplacian level 0 left pyramidright pyramidblended pyramid

Richard SzeliskiImage Stitching51 Laplacian image blend 1.Compute Laplacian pyramid 2.Compute Gaussian pyramid on weight image (can put this in A channel) 3.Blend Laplacians using Gaussian blurred weights 4.Reconstruct the final image Q: How do we compute the original weights? A: For horizontal panorama, use mid-lines Q: How about for a general “3D” panorama?

Richard SzeliskiImage Stitching52 Poisson Image Editing Blend the gradients of the two images, then integrate For more info: Perez et al, SIGGRAPH 2003