mosaics con’t

31
Mosaics con’t CSE 455, Winter 2010 February 10, 2010

Upload: tiger-lancaster

Post on 01-Jan-2016

41 views

Category:

Documents


2 download

DESCRIPTION

Mosaics con’t. CSE 455, Winter 2010 February 10 , 2010. Announcements. The Midterm: Due this Friday, Feb 12, at the beginning of class Late exams will not be accepted Additional Office Hour today: 2:30 to 3:30 in CSE 212 (the normal place). Review From Last Time. How to do it?. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Mosaics  con’t

Mosaics con’tCSE 455, Winter 2010

February 10, 2010

Page 2: Mosaics  con’t

Neel Joshi, CSE 455, Winter 20102

Announcements

The Midterm: Due this Friday, Feb 12, at the beginning of class Late exams will not be accepted

Additional Office Hour today: 2:30 to 3:30 in CSE 212 (the normal place)

Page 3: Mosaics  con’t

Neel Joshi, CSE 455, Winter 20103

Review From Last Time

Page 4: Mosaics  con’t

Neel Joshi, CSE 455, Winter 20104

How to do it?

Similar to Structure from Motion, but easier 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

Page 5: Mosaics  con’t

Neel Joshi, CSE 455, Winter 20105

Panoramic StitchingInput

Goal

Page 6: Mosaics  con’t

Neel Joshi, CSE 455, Winter 20106

Aligning images

How to account for warping? Translations are not enough to align the images Homographies!!!

Page 7: Mosaics  con’t

Neel Joshi, CSE 455, Winter 20107

p1,1

p1,2p1,3

Image 1

Image 2

Image 3

x1

x4

x3

x2

x5x6

x7

R1,t1

R2,t2

R3,t3

Structure from Motion: Image reprojection

Page 8: Mosaics  con’t

Neel Joshi, CSE 455, Winter 20108

p1,2

Image 1 Image 2 Image 3

x1

x4

x3

x2

x5x6

x7

R1 R2 R3

Panoramas: Image reprojection

Page 9: Mosaics  con’t

Neel Joshi, CSE 455, Winter 20109

mosaic plane

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

Page 10: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201010

Image warping with homographies

image plane in front image plane belowblack area

where no pixelmaps to

Page 11: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201011

Basic Procedure

Take a sequence of images from the same position Rotate the camera about its optical center

Compute correspondence between second image and first 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

ü

Page 12: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201012

Basic Procedure

Take a sequence of images from the same position Rotate the camera about its optical center

Compute correspondence between second image and first 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

ü

Page 13: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201013

Correspondence and Transformation

Compute correspondence between second image and first Compute transformation between second image and first

What kind of transformation Homography!!!

Do we know the correspondence?

Page 14: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201014

Let’s come up with an algorithm

Page 15: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201015

Let’s come up with an algorithm

Guess some matches

Compute a transformation using those matches

Check if the transformation is good

Page 16: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201016

RANSAC Randomly choose a set of K potential correspondences

Typically K is the minimum size that lets you fit a model How many for a

Translation rotation?Affine?Homography?

Fit a model (e.g., translation, homography) to those correspondences Count the number of inliers that “approximately” fit the model

Need a threshold on the error Repeat as many times as you can Choose the model that has the largest set of inliers Refine the model by doing a least squares fit using ALL of the inliers

Page 17: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201017

Simple Case: Translation

Page 18: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201018

Computing image translations

What do we do about the “bad” matches?

Page 19: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201019

RAndom SAmple Consensus

Select one match, count inliers(in this case, only one)

Page 20: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201020

RAndom SAmple Consensus

Select one match, count inliers(4 inliers)

Page 21: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201021

Least squares fit

Find “average” translation vectorfor largest set of inliers

Page 22: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201022

RANSAC Same basic approach works for any transformation

Translation, rotation, homographies, etc. Very useful tool

General version Randomly choose a set of K correspondences

Typically K is the minimum size that lets you fit a model Fit a model (e.g., homography) to those correspondences Count the number of inliers that “approximately” fit the model

Need a threshold on the error Repeat as many times as you can Choose the model that has the largest set of inliers Refine the model by doing a least squares fit using ALL of the inliers

Page 23: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201024

Basic Procedure

Take a sequence of images from the same position Rotate the camera about its optical center

Compute correspondence between second image and first 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

ü

ü

Page 24: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201025

Basic Procedure

Take a sequence of images from the same position Rotate the camera about its optical center

Compute correspondence between second image and first 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

ü

ü

Page 25: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201026

Assembling the panorama

Stitch pairs together, blend, then crop

Page 26: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201027

Problem: Drift

Error accumulation small errors accumulate over time

Page 27: Mosaics  con’t

Neel Joshi, CSE 455, Winter 201028

Image Blending

Page 28: Mosaics  con’t

Neel Joshi, CSE 455, Winter 2010

Feathering

01

01

+

=

Page 29: Mosaics  con’t

Neel Joshi, CSE 455, Winter 2010

Effect of window size

0

1 left

right0

1

Page 30: Mosaics  con’t

Neel Joshi, CSE 455, Winter 2010

Effect of window size

0

1

0

1

Page 31: Mosaics  con’t

Neel Joshi, CSE 455, Winter 2010

Good window size

0

1

“Optimal” window: smooth but not ghosted• Doesn’t always work...