Image Stitching. Richard Szeliski Microsoft Research IPAM Graduate Summer School: Computer Vision July 26, 2013

Similar documents
Build Panoramas on Android Phones

2-View Geometry. Mark Fiala Ryerson University

jorge s. marques image processing

Bildverarbeitung und Mustererkennung Image Processing and Pattern Recognition

Fast Image Labeling for Creating High-Resolution Panoramic Images on Mobile Devices

Ultra-High Resolution Digital Mosaics

Feature Tracking and Optical Flow

Simultaneous Gamma Correction and Registration in the Frequency Domain

High-Resolution Multiscale Panoramic Mosaics from Pan-Tilt-Zoom Cameras

INTRODUCTION TO RENDERING TECHNIQUES

Segmentation of building models from dense 3D point-clouds

A Learning Based Method for Super-Resolution of Low Resolution Images

Computer Graphics CS 543 Lecture 12 (Part 1) Curves. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Geometric Camera Parameters

VIRGINIA WESTERN COMMUNITY COLLEGE

Shear :: Blocks (Video and Image Processing Blockset )

The Concept(s) of Mosaic Image Processing. by Fabian Neyer

Interpolation of RGB components in Bayer CFA images

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines

Aliasing, Image Sampling and Reconstruction

Making High Dynamic Range (HDR) Panoramas with Hugin

3D Scanner using Line Laser. 1. Introduction. 2. Theory

A Proposal for OpenEXR Color Management

Image Stitching based on Feature Extraction Techniques: A Survey

Retina Mosaicing Using Local Features

Visualization and Feature Extraction, FLOW Spring School 2016 Prof. Dr. Tino Weinkauf. Flow Visualization. Image-Based Methods (integration-based)

Lecture 12: Cameras and Geometry. CAP 5415 Fall 2010

PERFORMANCE ANALYSIS OF HIGH RESOLUTION IMAGES USING INTERPOLATION TECHNIQUES IN MULTIMEDIA COMMUNICATION SYSTEM

How To Analyze Ball Blur On A Ball Image

A PHOTOGRAMMETRIC APPRAOCH FOR AUTOMATIC TRAFFIC ASSESSMENT USING CONVENTIONAL CCTV CAMERA

Understanding astigmatism Spring 2003

Admin stuff. 4 Image Pyramids. Spatial Domain. Projects. Fourier domain 2/26/2008. Fourier as a change of basis

521493S Computer Graphics. Exercise 2 & course schedule change

Stitching of X-ray Images

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

Using Photorealistic RenderMan for High-Quality Direct Volume Rendering

An Iterative Image Registration Technique with an Application to Stereo Vision

Interactive 3D Scanning Without Tracking

Planetary Imaging Workshop Larry Owens

COMP : 096: Computational Photography

Video stabilization for high resolution images reconstruction

Computational Foundations of Cognitive Science

Microsoft Research WorldWide Telescope Multi-Channel Dome/Frustum Setup Guide

PARALLAX EFFECT FREE MOSAICING OF UNDERWATER VIDEO SEQUENCE BASED ON TEXTURE FEATURES

ACE: After Effects CC

Part-Based Recognition

B2.53-R3: COMPUTER GRAPHICS. NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions.

Computer Graphics. Geometric Modeling. Page 1. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science - Technion. An Example.

3D Model based Object Class Detection in An Arbitrary View

Epipolar Geometry. Readings: See Sections 10.1 and 15.6 of Forsyth and Ponce. Right Image. Left Image. e(p ) Epipolar Lines. e(q ) q R.

Latest Results on High-Resolution Reconstruction from Video Sequences

Image Alignment and Stitching: A Tutorial

Lenses and Telescopes

Metrics on SO(3) and Inverse Kinematics

Camera geometry and image alignment

Least-Squares Intersection of Lines

Imaging Systems Laboratory II. Laboratory 4: Basic Lens Design in OSLO April 2 & 4, 2002

Introduction to Computer Graphics

What Makes a Great Picture?

Procedure: Geometrical Optics. Theory Refer to your Lab Manual, pages Equipment Needed

CS 534: Computer Vision 3D Model-based recognition

Curves and Surfaces. Goals. How do we draw surfaces? How do we specify a surface? How do we approximate a surface?

ROBUST COLOR JOINT MULTI-FRAME DEMOSAICING AND SUPER- RESOLUTION ALGORITHM

Color Segmentation Based Depth Image Filtering

A Study on SURF Algorithm and Real-Time Tracking Objects Using Optical Flow

Multivariate data visualization using shadow

Introduction to Imagery and Raster Data in ArcGIS

Lecture 2: Homogeneous Coordinates, Lines and Conics

Description of field acquisition of LIDAR point clouds and photos. CyberMapping Lab UT-Dallas

Probabilistic Latent Semantic Analysis (plsa)

Immersive Medien und 3D-Video

Panoramic and High Resolution Photography. Max Lyons

Computational Optical Imaging - Optique Numerique. -- Deconvolution --

High Quality Image Magnification using Cross-Scale Self-Similarity

Consolidated Visualization of Enormous 3D Scan Point Clouds with Scanopy

Point Lattices in Computer Graphics and Visualization how signal processing may help computer graphics

A System for Capturing High Resolution Images

Fast Image-Based Tracking by Selective Pixel Integration

A. OPENING POINT CLOUDS. (Notepad++ Text editor) (Cloud Compare Point cloud and mesh editor) (MeshLab Point cloud and mesh editor)

Geometric Modelling & Curves

Make and Model Recognition of Cars

Photo Uncrop. 1 Introduction. Qi Shan, Brian Curless, Yasutaka Furukawa, Carlos Hernandez, and Steven M. Seitz

Projection Center Calibration for a Co-located Projector Camera System

We can display an object on a monitor screen in three different computer-model forms: Wireframe model Surface Model Solid model

How does the Kinect work? John MacCormick

The Photosynth Photography Guide

CS231M Project Report - Automated Real-Time Face Tracking and Blending

Lecture 2: Geometric Image Transformations

3-D Scene Data Recovery using Omnidirectional Multibaseline Stereo

A Short Introduction to Computer Graphics

Robert Collins CSE598G. More on Mean-shift. R.Collins, CSE, PSU CSE598G Spring 2006

PCL - SURFACE RECONSTRUCTION

Rodenstock Photo Optics

The process components and related data characteristics addressed in this document are:

ACE: After Effects CS6

Digital Photography Composition. Kent Messamore 9/8/2013

Introduction Epipolar Geometry Calibration Methods Further Readings. Stereo Camera Calibration

Image Segmentation and Registration

Transcription:

Image Stitching Richard Szeliski Microsoft Research IPAM Graduate Summer School: Computer Vision July 26, 2013

Panoramic Image Mosaics 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 Richard Szeliski Image Stitching 2

Gigapixel panoramas & images Mapping / Tourism / WWT Medical Imaging Richard Szeliski Image Stitching 3

Gigapixel panoramas & images Photosynth Richard Szeliski Image Stitching 4

Image Mosaics + + + = Goal: Stitch together several images into a seamless composite Richard Szeliski Image Stitching 5

Today s lecture Image alignment and stitching motion models image warping point-based alignment complete mosaics (global alignment) compositing and blending ghost and parallax removal Richard Szeliski Image Stitching 6

Readings Szeliski, CVAA: Chapter 3.6: Image warping Chapter 6.1: Feature-based alignment Chapter 9.1: Motion models Chapter 9.2: Global alignment Chapter 9.3: Compositing Recognizing Panoramas, Brown & Lowe, ICCV 2003 Szeliski & Shum, SIGGRAPH'97 Richard Szeliski Image Stitching 7

Motion models

Motion models What happens when we take two images with a camera and try to align them? translation? rotation? scale? affine? perspective? see interactive demo (VideoMosaic) Richard Szeliski Image Stitching 9

Projective transformations (aka homographies) keystone distortions Richard Szeliski Image Stitching 10

Image Warping

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

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

Parametric (global) warping Examples of parametric warps: translation rotation aspect perspective affine cylindrical Richard Szeliski Image Stitching 14

2D coordinate transformations translation: x = x + t x = (x,y) rotation: similarity: affine: x = R x + t x = s R x + t 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 Szeliski Image Stitching 15

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))? h(x) x f(x) x g(x ) Richard Szeliski Image Stitching 16

Forward Warping Send each pixel f(x) to its corresponding location x = h(x) in g(x ) What if pixel lands between two pixels? h(x) x f(x) x g(x ) Richard Szeliski Image Stitching 17

Forward Warping Send each pixel f(x) to its corresponding location x = h(x) in g(x ) What if pixel lands between two pixels? Answer: add contribution to several pixels, normalize later (splatting) h(x) x f(x) x g(x ) Richard Szeliski Image Stitching 18

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? h(x) x f(x) x g(x ) Richard Szeliski Image Stitching 19

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 x f(x) x g(x ) Richard Szeliski Image Stitching 20

Interpolation Possible interpolation filters: nearest neighbor bilinear bicubic (interpolating) sinc / FIR Needed to prevent jaggies and texture crawl Richard Szeliski Image Stitching 21

Motion models (reprise)

Motion models Translation Affine Perspective 3D rotation 2 unknowns 6 unknowns 8 unknowns 3 unknowns Richard Szeliski Image Stitching 25

Finding the transformation Translation = 2 degrees of freedom Similarity = 4 degrees of freedom Affine = 6 degrees of freedom Homography = 8 degrees of freedom How many corresponding points do we need to solve? Richard Szeliski Image Stitching 26

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 Szeliski Image Stitching 27

Rotational mosaics Directly optimize rotation and focal length Advantages: ability to build full-view panoramas easier to control interactively more stable and accurate estimates Richard Szeliski Image Stitching 29

3D 2D Perspective Projection (X c,y c,z c ) f u c u Richard Szeliski Image Stitching 30

Rotational mosaic Projection equations 1. Project from image to 3D ray (x 0,y 0,z 0 ) = (u 0 -u c,v 0 -v c,f) 2. Rotate the ray by camera motion (x 1,y 1,z 1 ) = R 01 (x 0,y 0,z 0 ) 3. Project back into new (source) image (u 1,v 1 ) = (fx 1 /z 1 +u c,fy 1 /z 1 +v c ) Richard Szeliski Image Stitching 31

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

Image Mosaics (stitching) Blend together several overlapping images into one seamless mosaic (composite) + + + = Richard Szeliski Image Stitching 37

Mosaics for Video Coding Convert masked images into a background sprite for content-based coding + + + = Richard Szeliski Image Stitching 38

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 Szeliski Image Stitching 39

Stitching demo Richard Szeliski Image Stitching 41

Panoramas What if you want a 360 field of view? mosaic Projection Cylinder Richard Szeliski Image Stitching 42

Cylindrical panoramas Steps Reproject each image onto a cylinder Blend Output the resulting mosaic Richard Szeliski Image Stitching 43

Cylindrical Panoramas Map image to cylindrical or spherical coordinates need known focal length Image 384x300 f = 180 (pixels) f = 280 f = 380 Richard Szeliski Image Stitching 44

Cylindrical projection Map 3D point (X,Y,Z) onto cylinder Y Z X unit cylinder Convert to cylindrical coordinates Convert to cylindrical image coordinates s defines size of the final image unwrapped cylinder cylindrical image Richard Szeliski Image Stitching 47

Cylindrical warping Given focal length f and image center (x c,y c ) (X,Y,Z) Y (sinq,h,cosq) Z X Richard Szeliski Image Stitching 48

Spherical warping Given focal length f and image center (x c,y c ) (x,y,z) φ cos φ Y Z X (sinθcosφ, sinφ, cosθcosφ) sin φ cos θ cos φ Richard Szeliski Image Stitching 49

3D rotation Rotate image before placing on unrolled sphere (x,y,z) (sinθcosφ, sinφ, cosθcosφ) p = R p φ cos φ sin φ cos θ cos φ Richard Szeliski Image Stitching 50

Radial distortion Correct for bending in wide field of view lenses Project to normalized image coordinates Apply radial distortion Apply focal length translate image center To model lens distortion Use above projection operation instead of standard projection matrix multiplication Richard Szeliski Image Stitching 51

Fisheye lens Extreme bending in ultra-wide fields of view Richard Szeliski Image Stitching 52

Matching features What do we do about the bad matches? Richard Szeliski Image Stitching 53

RAndom SAmple Consensus Select one match, count inliers Richard Szeliski Image Stitching 54

RAndom SAmple Consensus Select one match, count inliers Richard Szeliski Image Stitching 55

Least squares fit Find average translation vector Richard Szeliski Image Stitching 56

RANSAC for estimating homography RANSAC loop: 1. Select four feature pairs (at random) 2. Compute homography H (exact) 3. Compute inliers where p i, H p i < ε Keep largest set of inliers Re-compute least-squares H estimate using all of the inliers Richard Szeliski Image Stitching 57

Simple example: fit a line Rather than homography H (8 numbers) fit y=ax+b (2 numbers a, b) to 2D pairs 58

Simple example: fit a line Pick 2 points Fit line Count inliers 3 inliers 59

Simple example: fit a line Pick 2 points Fit line Count inliers 4 inliers 60

Simple example: fit a line Pick 2 points Fit line Count inliers 9 inliers 61

Simple example: fit a line Pick 2 points Fit line Count inliers 8 inliers 62

Simple example: fit a line Use biggest set of inliers Do least-square fit 63

RANSAC red: rejected by 2nd nearest neighbor criterion blue: Ransac outliers yellow: inliers Richard Szeliski Image Stitching 64

Image Stitching review 1. Align the images over each other camera pan translation on cylinder 2. Blend the images together (demo) Richard Szeliski Image Stitching 65

Full-view (360 spherical) panoramas

Full-view Panorama + + + + Richard Szeliski Image Stitching 70

Texture Mapped Model Richard Szeliski Image Stitching 71

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) Richard Szeliski Image Stitching 72

Recognizing Panoramas Matthew Brown & David Lowe ICCV 2003

Recognizing Panoramas [Brown & Lowe, ICCV 03] Richard Szeliski Image Stitching 74

Finding the panoramas Richard Szeliski Image Stitching 75

Finding the panoramas Richard Szeliski Image Stitching 76

Finding the panoramas Richard Szeliski Image Stitching 77

Finding the panoramas Richard Szeliski Image Stitching 78

Fully automated 2D stitching Demo Richard Szeliski Image Stitching 79

http://windows.microsoft.com/en-us/windows-live/photo-gallery Richard Szeliski Image Stitching 80

Rec.pano.: system components 1. Feature detection and description more uniform point density 2. Fast matching (hash table) 3. RANSAC filtering of matches 4. Intensity-based verification 5. Incremental bundle adjustment [M. Brown, R. Szeliski, and S. Winder. Multi-image matching using multi-scale oriented patches, CVPR'2005] Richard Szeliski Image Stitching 81

Probabilistic Feature Matching Richard Szeliski Image Stitching 85

RANSAC motion model Richard Szeliski Image Stitching 86

RANSAC motion model Richard Szeliski Image Stitching 87

RANSAC motion model Richard Szeliski Image Stitching 88

Probabilistic model for verification Richard Szeliski Image Stitching 89

How well does this work? Test on 100s of examples

How well does this work? Test on 100s of examples still too many failures (5-10%) for consumer application

Matching Mistakes: False Positive Richard Szeliski Image Stitching 92

Matching Mistakes: False Positive Richard Szeliski Image Stitching 93

Matching Mistake: False Negative Moving objects: large areas of disagreement Richard Szeliski Image Stitching 94

Matching Mistakes Accidental alignment repeated / similar regions Failed alignments moving objects / parallax low overlap feature-less regions (more variety?) No 100% reliable algorithm? Richard Szeliski Image Stitching 95

How can we fix these? Tune the feature detector Tune the feature matcher (cost metric) Tune the RANSAC stage (motion model) Tune the verification stage Use higher-level knowledge e.g., typical camera motions Sounds like a big learning problem Need a large training/test data set (panoramas) Richard Szeliski Image Stitching 96

Image Blending

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 Szeliski Image Stitching 98

Image Feathering Richard Szeliski Image Stitching 99

Feathering + 1 0 = 1 0 Richard Szeliski Image Stitching 100

Effect of window size 1 left 1 0 right 0 Richard Szeliski Image Stitching 101

Effect of window size 1 1 0 0 Richard Szeliski Image Stitching 102

Good window size 1 0 Optimal window: smooth but not ghosted Doesn t always work... Richard Szeliski Image Stitching 103

Pyramid Blending Burt, P. J. and Adelson, E. H., A multiresolution spline with applications to image Richard Szeliski Image Stitching 104 mosaics, ACM Transactions on Graphics, 42(4), October 1983, 217-236.

Laplacian level 4 Laplacian level 2 Laplacian level 0 Richard Szeliski Image Stitching 105 left pyramid right pyramid blended pyramid

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 Szeliski Image Stitching 106

Weight selection (3D panorama) Idea: use original feather weights to select strongest contributing image Can be implemented using L- norm: (p = 10) w i = [w ip / ( i w ip )] 1/p Richard Szeliski Image Stitching 107

Poisson Image Editing Blend the gradients of the two images, then integrate [Perez et al, SIGGRAPH 2003] Richard Szeliski Image Stitching 108

De-Ghosting

Local alignment (deghosting) Use local optic flow to compensate for small motions [Shum & Szeliski, ICCV 98] Richard Szeliski Image Stitching 110

Local alignment (deghosting) Use local optic flow to compensate for radial distortion [Shum & Szeliski, ICCV 98] Richard Szeliski Image Stitching 111

Region-based de-ghosting Select only one image in regions-of-difference using weighted vertex cover [Uyttendaele et al., CVPR 01] Richard Szeliski Image Stitching 112

Region-based de-ghosting Select only one image in regions-of-difference using weighted vertex cover [Uyttendaele et al., CVPR 01] Richard Szeliski Image Stitching 113

Cutout-based de-ghosting Select only one image per output pixel, using spatial continuity Blend across seams using gradient continuity ( Poisson blending ) [Agarwala et al., SG 2004] Richard Szeliski Image Stitching 114

Cutout-based compositing Photomontage [Agarwala et al., SG 2004] Interactively blend different images: group portraits Richard Szeliski Image Stitching 115

PhotoMontage Technical details: use Graph Cuts to optimize seam placement Demo: Windows Live Photo Gallery Photo Fuse Richard Szeliski Image Stitching 116

Cutout-based compositing Photomontage [Agarwala et al., SG 2004] Interactively blend different images: focus settings Richard Szeliski Image Stitching 117

Cutout-based compositing Photomontage [Agarwala et al., SG 2004] Interactively blend different images: people s faces Richard Szeliski Image Stitching 118

More stitching possibilities Video stitching High dynamic range image stitching Flash + Non-Flash Video-based rendering Related lecture: Computational Photography Richard Szeliski Image Stitching 119

Other types of mosaics Can mosaic onto any surface if you know the geometry See NASA s Visible Earth project for some stunning earth mosaics http://earthobservatory.nasa.gov/newsroom/bluemarble/ Richard Szeliski Image Stitching 120

Slit images y-t slices of the video volume are known as slit images take a single column of pixels from each input image Richard Szeliski Image Stitching 121

Slit images: cyclographs Richard Szeliski Image Stitching 122

Slit images: photofinish Richard Szeliski Image Stitching 123

Final thought: What is a panorama? Tracking a subject Repeated (best) shots Multiple exposures Infer what photographer wants? Richard Szeliski Image Stitching 124

( Questions ) [ The End ]