Image stitching Digital Visual Effects Yung-Yu Chuang with slides by Richard Szeliski, Steve Seitz, Matthew Brown and Vaclav Hlavac.

Slides:



Advertisements
Similar presentations
Recognising Panoramas M. Brown and D. Lowe, University of British Columbia.
Advertisements

RANSAC and mosaic wrap-up cs129: Computational Photography James Hays, Brown, Fall 2012 © Jeffrey Martin (jeffrey-martin.com) most slides from Steve Seitz,
More Mosaic Madness : Computational Photography Alexei Efros, CMU, Fall 2011 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen from.
RANSAC and mosaic wrap-up cs195g: Computational Photography James Hays, Brown, Spring 2010 © Jeffrey Martin (jeffrey-martin.com) most slides from Steve.
CSCE 641 Computer Graphics: Image Mosaicing Jinxiang Chai.
Mosaics con’t CSE 455, Winter 2010 February 10, 2010.
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.
Recognising Panoramas
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?
Automatic Panoramic Image Stitching using Local Features Matthew Brown and David Lowe, University of British Columbia.
Lecture 11: Structure from motion CS6670: 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.
CS664 Lecture #19: Layers, RANSAC, panoramas, epipolar geometry Some material taken from:  David Lowe, UBC  Jiri Matas, CMP Prague
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.
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.
Global Alignment and Structure from Motion Computer Vision CSE455, Winter 2008 Noah Snavely.
Announcements Project 1 artifact voting Project 2 out today (help session at end of class)
Lecture 12: Structure from motion CS6670: Computer Vision Noah Snavely.
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.
Advanced Computer Vision Feature-based Alignment Lecturer: Lu Yi & Prof. Fuh CSIE NTU.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
Image Stitching Shangliang Jiang Kate Harrison. What is image stitching?
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.
Example: line fitting. n=2 Model fitting Measure distances.
CSCE 643 Computer Vision: Structure from Motion
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.
Advanced Computer Vision CH6. Feature-based Alignment
Mosaics part 3 CSE 455, Winter 2010 February 12, 2010.
Linearizing (assuming small (u,v)): Brightness Constancy Equation: The Brightness Constraint Where:),(),(yxJyxII t  Each pixel provides 1 equation in.
Announcements No midterm Project 3 will be done in pairs same partners as for project 2.
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.
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.
CS4670 / 5670: Computer Vision Kavita Bala Lecture 20: Panoramas.
More Mosaic Madness © Jeffrey Martin (jeffrey-martin.com)
COSC579: Image Align, Mosaic, Stitch
The Brightness Constraint
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)
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 Computer Vision CS 678
More Mosaic Madness © Jeffrey Martin (jeffrey-martin.com)
Announcements Project 1 Project 2 Vote for your favorite artifacts!
Announcements Project 1 artifact voting Project 2 out today
Computational Photography
Calibration and homographies
Image Stitching Linda Shapiro ECE/CSE 576.
Image Stitching Linda Shapiro ECE P 596.
Presentation transcript:

Image stitching Digital Visual Effects Yung-Yu Chuang with slides by Richard Szeliski, Steve Seitz, Matthew Brown and Vaclav Hlavac

Image stitching Stitching = alignment + blending geometrical registration photometric registration

Applications of image stitching Video stabilization Video summarization Video compression Video matting Panorama creation

Video summarization

Video compression

Object removal input video

Object removal remove foreground

Object removal estimate background

Object removal background estimation

Panorama creation

Why panorama? Are you getting the whole picture? –Compact Camera FOV = 50 x 35°

Why panorama? Are you getting the whole picture? –Compact Camera FOV = 50 x 35° –Human FOV = 200 x 135°

Why panorama? Are you getting the whole picture? –Compact Camera FOV = 50 x 35° –Human FOV = 200 x 135° –Panoramic Mosaic = 360 x 180°

Panorama examples Similar to HDR, it is a topic of computational photography, seeking ways to build a better camera using either hardware or software. Most consumer cameras have a panorama mode Mars: Earth:

What can be globally aligned? In image stitching, we seek for a matrix to globally warp one image into another. Are any two images of the same scene can be aligned this way? –Images captured with the same center of projection –A planar scene or far-away scene

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!

Mosaic as an image reprojection mosaic projection plane The images are reprojected onto a common plane The mosaic is formed on this plane Mosaic is a synthetic wide-angle camera

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

What cannot The scene with depth variations and the camera has movement

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

Motion models Parametric models as the assumptions on the relation between two images.

2D Motion models

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

A case study: cylindrical panorama What if you want a 360  field of view? mosaic projection cylinder

Cylindrical panoramas Steps –Reproject each image onto a cylinder –Blend –Output the resulting mosaic

applet plets/projection.htmlhttp://graphics.stanford.edu/courses/cs178/ap plets/projection.html

Cylindrical panorama 1.Take pictures on a tripod (or handheld) 2.Warp to cylindrical coordinate 3.Compute pairwise alignments 4.Fix up the end-to-end alignment 5.Blending 6.Crop the result and import into a viewer It is required to do radial distortion correction for better stitching results!

Taking pictures Kaidan panoramic tripod head

Translation model

Where should the synthetic camera be The projection plane of some camera Onto a cylinder real camera synthetic camera

Cylindrical projection Adopted from

Cylindrical projection

Adopted from

Cylindrical projection unwrapped cylinder x y f x θ

z Cylindrical projection unwrapped cylinder x y θ x y f

Cylindrical projection unwrapped cylinder x y z x y f s=f gives less distortion

f = 180 (pixels) Cylindrical reprojection f = 380f = 280 Image 384x300 top-down view Focal length – the dirty secret…

A simple method for estimating f Or, you can use other software, such as AutoStich, to help. d f w p

Input images

Cylindrical warping

Blending Why blending: parallax, lens distortion, scene motion, exposure difference

Blending

Gradient-domain stitching

Panorama weaving

Assembling the panorama Stitch pairs together, blend, then crop

Problem: Drift Error accumulation –small errors accumulate over time

Problem: Drift Solution –add another copy of first image at the end –there are a bunch of ways to solve this problem add displacement of (y 1 – y n )/(n -1) to each image after the first compute a global warp: y ’ = y + ax run a big optimization problem, incorporating this constraint –best solution, but more complicated –known as “ bundle adjustment ” (x 1,y 1 ) copy of first image (x n,y n )

End-to-end alignment and crop

Rectangling panoramas video

Rectangling panoramas

Viewer: panorama example:

Viewer: texture mapped model example:

Cylindrical panorama 1.Take pictures on a tripod (or handheld) 2.Warp to cylindrical coordinate 3.Compute pairwise alignments 4.Fix up the end-to-end alignment 5.Blending 6.Crop the result and import into a viewer

Determine pairwise alignment? Feature-based methods: only use feature points to estimate parameters We will study the “Recognising panorama” paper published in ICCV 2003 Run SIFT (or other feature algorithms) for each image, find feature matches.

Determine pairwise alignment p’=Mp, where M is a transformation matrix, p and p’ are feature matches It is possible to use more complicated models such as affine or perspective For example, assume M is a 2x2 matrix Find M with the least square error

Determine pairwise alignment Overdetermined system

Normal equation Given an overdetermined system the normal equation is that which minimizes the sum of the square differences between left and right sides Why?

Normal equation n x m, n equations, m variables

Normal equation

Determine pairwise alignment p’=Mp, where M is a transformation matrix, p and p’ are feature matches For translation model, it is easier. What if the match is false? Avoid impact of outliers.

RANSAC RANSAC = Random Sample Consensus An algorithm for robust fitting of models in the presence of many data outliers Compare to robust statistics Given N data points x i, assume that majority of them are generated from a model with parameters , try to recover .

RANSAC algorithm Run k times: (1) draw n samples randomly (2) fit parameters  with these n samples (3) for each of other N-n points, calculate its distance to the fitted model, count the number of inlier points, c Output  with the largest c How many times? How big? Smaller is better How to define? Depends on the problem.

How to determine k p : probability of real inliers P : probability of success after k trials n samples are all inliers a failure failure after k trials npk for P=0.99

Example: line fitting

n=2

Model fitting

Measure distances

Count inliers c=3

Another trial c=3

The best model c=15

RANSAC for Homography

Applications of panorama in VFX Background plates Image-based lighting

Troy (image-based lighting)

Spiderman 2 (background plate)

Reference Richard Szeliski, Image Alignment and Stitching: A Tutorial, Foundations and Trends in Computer Graphics and Computer Vision, 2(1):1-104, December 2006.Image Alignment and Stitching: A Tutorial R. Szeliski and H.-Y. Shum. Creating full view panoramic image mosaics and texture-mapped models, SIGGRAPH 1997, pp Creating full view panoramic image mosaics and texture-mapped models M. Brown, D. G. Lowe, Recognising Panoramas, ICCV 2003.Recognising Panoramas