structure and motion from discrete viewsaz/lectures/cv/lecture6.pdf · structure and motion from...

47
Structure and Motion from Discrete Views Introduction Computing the fundamental matrix, F, from corner correspondences Feature matching RANSAC Estimation Determining ego-motion from F Computing a homography, H, from corner correspondences SIFT for wide baseline matching More than two views Batch and sequential solutions

Upload: others

Post on 19-Aug-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Structure and Motion from Discrete Views

• Introduction

• Computing the fundamental matrix, F, from corner correspondences

• Feature matching

• RANSAC

• Estimation

• Determining ego-motion from F• Computing a homography, H, from corner correspondences

• SIFT for wide baseline matching

• More than two views

• Batch and sequential solutions

Page 2: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Cameras rotating about their centre

image plane 1

image plane 2

• The two image planes are related by a homography H

• H depends only on the relation between the image planes and camera centre, C, not on the 3D structure

P = K [ I | 0 ] P’ = K’ [ R | 0 ]

H = K’ R K^(-1)

Page 3: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Four points define a projective transformation

Page 4: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Automatic computation of a homography

• Given an image pair:

1. Compute interest points (feature detection)

2. Compute putative (hypothesised) correspondences

3. Compute the homography from the correspondences

Page 5: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Interest point detection

500 points in each image

Page 6: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 7: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Initial correspondences Final correspondences

Page 8: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Computing a panoramic mosaic

• camera rotates about its centre

• focal length can also change (zoom)

Page 9: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Choice of mosaic frame

• This produces the classic "bow-tie"mosaic.

Choose central image as reference

Page 10: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 11: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Wide Baseline Matching• Suppose we wish to compute F between any image pair (not restricted to small camera motion between views)

Page 12: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Wide Baseline Matching• Why does the short baseline computation fail?• Recall three steps:

1.1.Compute interest pointsCompute interest points2.2.Compute putative point correspondencesCompute putative point correspondences3.3.RANSAC estimation of F and consistent correspondence set.RANSAC estimation of F and consistent correspondence set.

Page 13: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 14: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 15: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 16: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Derivative of Gaussian

gdxdf ∗

f

gdxd

Source: S. Seitz

Edge

Derivativeof Gaussian

Edge = maximumof derivative

Page 17: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Second derivative of Gaussian

gdxdf 2

2

f

gdxd

2

2

Edge

Second derivativeof Gaussian (Laplacian)

Edge = zero crossingof second derivative

Source: S. Seitz

Page 18: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Matched filter for blob detection

Scale-normalized Laplacian response

Unnormalized Laplacian responseOriginal signal

maximum

Page 19: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Blob detection in 2D• Laplacian of Gaussian: Circularly symmetric operator for

blob detection in 2D

⎟⎟⎠

⎞⎜⎜⎝

⎛∂∂

+∂∂

=∇ 2

2

2

222

norm yg

xgg σScale-normalized:

Page 20: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Scale-invariant feature detection

Page 21: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

• Approximating the Laplacian with a difference of Gaussians:

( )2 ( , , ) ( , , )xx yyL G x y G x yσ σ σ= +

( , , ) ( , , )DoG G x y k G x yσ σ= −

(Laplacian)

(Difference of Gaussians)

Efficient implementation

Page 22: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 23: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 24: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 25: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 26: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Select canonical orientation

• Create histogram of local gradient directions computed at selected scale

• Assign canonical orientation at peak of smoothed histogram

• Each key specifies stable 2D coordinates (x, y, scale, orientation)

0 2π

Page 27: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Example

Page 28: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Feature Descriptor

• distribution of the gradient over an image patchgradient 3D histogram

→ →

image patch

y

x

4x4 location grid and 8 orientations (128 dimensions)

Page 29: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Epipolar geometry example

512 x 768 pixel images

Page 30: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

interest points and scales

Now, match SIFT descriptors between images

Page 31: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

All matches consistent with epipolar geometry

156 matches consistent with epipolar geometry

Page 32: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Epipolar geometry

Page 33: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Ex: Panoramas from an unordered image set

Page 34: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Autostitch, Mat Brown & David Lowe

Page 35: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 36: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 37: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 38: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 39: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 40: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Application: Post-production special effectsoriginal sequence

Page 41: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner

Augmentation

Page 42: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 43: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 44: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 45: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 46: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner
Page 47: Structure and Motion from Discrete Viewsaz/lectures/cv/lecture6.pdf · Structure and Motion from Discrete Views • Introduction • Computing the fundamental matrix, F, from corner