COSC579: Image Align, Mosaic, Stitch

Slides:



Advertisements
Similar presentations
Mosaics con’t CSE 455, Winter 2010 February 10, 2010.
Advertisements

Lecture 11: Transformations CS4670/5760: Computer Vision Kavita Bala.
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...
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.
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 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,
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.
Panoramas and Calibration : Rendering and Image Processing Alexei Efros …with a lot of slides stolen from Steve Seitz and Rick Szeliski.
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 Stitching II Ali Farhadi CSE 455
Announcements Project 1 artifact voting Project 2 out today (help session at end of class)
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
CSC 589 Lecture 22 Image Alignment and least square methods Bei Xiao American University April 13.
What Does the Scene Look Like From a Scene Point? Donald Tanguay August 7, 2002 M. Irani, T. Hassner, and P. Anandan ECCV 2002.
Lecture 12: Image alignment CS4670/5760: Computer Vision Kavita Bala
Last Lecture (optical center) origin principal point P (X,Y,Z) p (x,y) x y.
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.
Reconnaissance d’objets et vision artificielle Jean Ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire.
Mosaics part 3 CSE 455, Winter 2010 February 12, 2010.
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) –
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.
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
Lecture 16: Image alignment
Image Stitching II Linda Shapiro EE/CSE 576.
Prof. Adriana Kovashka University of Pittsburgh October 3, 2016
CS4670 / 5670: Computer Vision Kavita Bala Lecture 20: Panoramas.
Computational Photography Derek Hoiem, University of Illinois
Lecture 7: Image alignment
Two-view geometry Computer Vision Spring 2018, Lecture 10
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.
Idea: projecting images onto a common plane
Announcements Project 2 out today (help session at end of class)
Image Stitching II Linda Shapiro EE/CSE 576.
Image Stitching II Linda Shapiro CSE 455.
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
Lecture 8: Image alignment
Lecture 8: Image alignment
Image Stitching II Linda Shapiro EE/CSE 576.
CS 534 Homework #4 References
Image Stitching Linda Shapiro ECE/CSE 576.
CS Homework #4 References
Lecture 11: Image alignment, Part 2
Image Stitching II Linda Shapiro ECE P 596.
Image Stitching Linda Shapiro ECE P 596.
Presentation transcript:

COSC579: Image Align, Mosaic, Stitch Jeremy Bolton, PhD Assistant Teaching Professor

Outline Multi-Image Vision Revisit scene geometry Image Warping Mosaic and Align Morphing Revisit scene geometry Image Warping Finding the appropriate transformation (warp) Forward Warping Backward Warping Implementation Details Holes Feathering

Image alignment Full screen panoramas (cubic): http://www.panoramas.dk/ Mars: http://www.panoramas.dk/fullscreen3/f2_mars97.html 2003 New Years Eve: http://www.panoramas.dk/fullscreen3/f1.html

Why Mosaic? Are you getting the whole picture? Compact Camera FOV = 50 x 35° Slide from Brown & Lowe

Why Mosaic? Are you getting the whole picture? Compact Camera FOV = 50 x 35° Human FOV = 200 x 135° Slide from Brown & Lowe

Why Mosaic? Are you getting the whole picture? Compact Camera FOV = 50 x 35° Human FOV = 200 x 135° Panoramic Mosaic = 360 x 180° Slide from Brown & Lowe

Mosaics: stitching images together

Image alignment Image taken from same viewpoint, just rotated. Can we line them up?

Image alignment Why don’t these image line up exactly?

What is the geometric relationship between these two images?

What is the geometric relationship between these two images?

Is this an affine transformation?

Problem: Transforming from one image to another Conceptually, given a camera matrix P, we can map a point to the image plane. The reverse transformation will map the image coordinate to a line (or point if we know the disparity or depth) If the Camera matrix for the second image is known, we can then map to the second image

Image reprojection Observation Rather than thinking of this as a 3D reprojection, think of it as a 2D image warp from one image to another

Transforming from one image to another Simplifying Assumption: Planar Scene Choose a plane to project back onto (planar scene) Analogous to replacing last row of P0 with homogeneous plane equation Observe the points map onto a plane, so we are not concerned about the depth (d=0) Thus we can ignore the last column of M10 Observe: This sequence of matrix operations can be collapsed into one 3x3 homography.

Transforming from one image to another Simplifying Assumption: Pure Rotation Assume no translation and only pure rotation (eg panorama) Assume the scene is “large”, points are at infinity. Assume no translation Assume simple Intrinsics Matrix This further simplification results in less parameters, since the rotation matrix entries can be calculated using 3 angles.

Homographies Perspective projection of a plane To apply a homography H Lots of names for this: Modeled as a 2D warp using homogeneous coordinates p’ H p To apply a homography H Compute p’ = Hp (regular matrix multiply) Convert p’ from homogeneous to image coordinates divide by w (third) coordinate

Image reprojection for mosaicing mosaic PP The mosaic has a natural interpretation in 3D The images are reprojected onto a common plane idea: replace camera with slide projector, project onto new PP The mosaic is formed on this plane

An Image Alignment Scheme (mosaic) Given images A and B Find corresponding points between images (You will manually do this for your assignment) Compute image features for A and B (Later!) Match features between A and B (Later!) Solve for homography between A and B using least squares on set of matches. Blend images (composite) What could go wrong?

Estimating Translations Problem: more equations than unknowns “Overdetermined” system of equations We will find the least squares solution

Simplified Least squares formulation For each point we define the residuals as

Least squares formulation Goal: minimize sum of squared residuals “Least squares” solution For translations, is equal to mean displacement

Simplified Least squares formulation Can also write as a matrix equation 2n x 2 2 x 1 2n x 1

Least squares Find t that minimizes To solve, form the normal equations

Affine Assumption: Oversimplification How many unknowns? How many equations per match? How many matches do we need?

Affine transformations Residuals: Cost function:

Affine transformations Matrix form 2n x 6 6 x 1 2n x 1

Solving for homographies

Solve for transformation parameters Observe: here we construct the A matrix differently (such that the linear combination with the transformation parameters yields 0). This is a different way to formulate the system of equations.

Solving for homographies 9 2n Defines a least squares problem: Since is only defined up to scale, solve for unit vector Solution: = eigenvector of with smallest eigenvalue Works with 4 or more points

We have now learned how to solve for warping transformation … Done? h(x,y) y y’ x x’ f(x,y) g(x’,y’) 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))?

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

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

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

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

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

Blending We’ve aligned the images – now what?

Blending Want to seamlessly blend them together

Image Blending

Feathering 1 + =

Effect of window size 1 left 1 right

Effect of window size 1 1

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

Alpha Blending Encoding blend weights: I(x,y) = (R, G, B, ) Optional: see Blinn (CGA, 1994) for details: http://ieeexplore.ieee.org/iel1/38/7531/00310740.pdf?isNumber=7531&prod=JNL&arnumber=310740&arSt=83&ared=87&arAuthor=Blinn%2C+J.F. I2 A: render as black Encoding blend weights: I(x,y) = (R, G, B, ) color at p = Implement this in two steps: 1. accumulate: add up the ( premultiplied) RGB values at each pixel 2. normalize: divide each pixel’s accumulated RGB by its  value Q: what if  = 0?

Other Fun Applications of Compositing and Blending

Some panorama examples Every image on Google Streetview

Poisson Image Editing For more info: Perez et al, SIGGRAPH 2003 http://research.microsoft.com/vision/cambridge/papers/perez_siggraph03.pdf

Magic: ghost removal M. Uyttendaele, A. Eden, and R. Szeliski. Eliminating ghosting and exposure artifacts in image mosaics. In Proceedings of the Interational Conference on Computer Vision and Pattern Recognition, volume 2, pages 509--516, Kauai, Hawaii, December 2001.

Magic: ghost removal How to handle motion? M. Uyttendaele, A. Eden, and R. Szeliski. Eliminating ghosting and exposure artifacts in image mosaics. In Proceedings of the Interational Conference on Computer Vision and Pattern Recognition, volume 2, pages 509--516, Kauai, Hawaii, December 2001.