Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture8.pdfPanorama Building: History 4...

Preview:

Citation preview

Prof. Feng Liu

Spring 2020

http://www.cs.pdx.edu/~fliu/courses/cs510/

04/23/2020

Last Time

Re-lighting

◼ HDR

2

Today

Panorama

◼ Overview

◼ Feature detection

3With slides by Prof. C. Dyer and K. Grauman

Panorama Building: History

4

Along the River During Ching Ming Festival

by Z.D Zhang (1085-1145 )

San Francisco from Rincon Hill, 1851,

by Martin Behrmanx

Panorama Building: A Concise History

The state of the art and practice is good at assembling

images into panoramas

◼ Mid 90s –Commercial Players (e.g. QuicktimeVR)

◼ Late 90s –Robust stitchers (in research)

◼ Early 00s –Consumer stitching common

◼ Mid 00s –Automation

5

Stitching Recipe

Align pairs of images

Align all to a common frame

Adjust (Global) & Blend

6

Stitching Images Together

7

When do two images “stitch”?

8

Images can be transformed to match

9

Images are related by Homographies

10

Compute Homographies

11

Automatic Feature Points Matching

Match local neighborhoods around points

Use descriptors to efficiently compare SIFT

◼ [Lowe 04] most common choice

12

Stitching Recipe

Align pairs of images

Align all to a common frame

Adjust (Global) & Blend

13

Wide Baseline Matching

• Images taken by cameras that are far apart make the

correspondence problem very difficult

• Feature-based approach: Detect and match feature

points in pairs of images

Credit: C. Dyer

• Detect feature points

• Find corresponding pairs

Matching with Features

Credit: C. Dyer

Matching with Features

Problem 1:

◼ Detect the same point

independently in both images

no chance to match!

We need a repeatable detector

Credit: C. Dyer

Matching with Features

Problem 2:

◼ For each point correctly

recognize the corresponding point

?

We need a reliable and distinctive descriptor

Credit: C. Dyer

Local: features are local, so robust to occlusion and clutter (no prior segmentation)

Invariant (or covariant) to many kinds of geometric and photometric transformations

Robust: noise, blur, discretization, compression, etc. do not have a big impact on the feature

Distinctive: individual features can be matched to a large database of objects

Quantity: many features can be generated for even small objects

Accurate: precise localization

Efficient: close to real-time performance

Properties of an Ideal Feature

Credit: C. Dyer

Problem 1: Detecting Good Feature Points

Credit: C. Dyer

[Image from T. Tuytelaars ECCV 2006 tutorial]

Hessian

Harris

Lowe: SIFT (DoG)

Mikolajczyk & Schmid:Hessian/Harris-Laplacian/Affine

Tuytelaars & Van Gool: EBR and IBR

Matas: MSER

Kadir & Brady: Salient Regions

Others

Feature Detectors

Credit: C. Dyer

C. Harris, M. Stephens, “A Combined Corner and Edge Detector,” 1988

Harris Corner Point Detector

Credit: C. Dyer

We should recognize the point by looking through a small window

Shifting a window in any direction should give a large change in response

Harris Detector: Basic Idea

Credit: C. Dyer

“flat” region:

no change in

all directions

“edge”:

no change along

the edge direction

“corner”:

significant change

in all directions

Harris Detector: Basic Idea

Credit: C. Dyer

2

,

( , ) ( , ) ( , ) ( , )x y

E u v w x y I x u y v I x y= + + −

Change of intensity for a (small) shift by [u,v] in image I:

IntensityShifted intensity

Weighting function

orWeighting function w(x,y) =

Gaussian1 in window, 0 outside

Harris Detector: Derivation

Credit: R. Szeliski

Calculus: Taylor Series Expansion

25

𝑓 𝑥 + 𝑢 = 𝑓 𝑥 + 𝑢𝑓′ 𝑥 + 𝑂(𝑢2)

A real function f (x+u) can be approximated as the 2nd order of its Taylor series expansion at a point x.

Apply 2nd order Taylor series expansion:

=

=

=

++=

yx

yx

yx

y

yx

x

yxIyxIyxwC

yxIyxwB

yxIyxwA

BvCuvAuvuE

,

,

2

,

2

22

),(),(),(

),(),(

),(),(

2),(

( , )A C u

E u v u vC B v

=

xyxII x = /),(

yyxII y = /),(

Harris Detector

Credit: R. Szeliski

( , ) ,u

E u v u v Mv

Expanding E(u,v) in a 2nd order Taylor series, we have, for small

shifts, [u,v], a bilinear approximation:

2

2,

( , )x x y

x y x y y

I I IM w x y

I I I

=

where M is a 2 2 matrix computed from image derivatives:

Note: Sum computed over small neighborhood around given pixel

xyxII x = /),(

yyxII y = /),(

Harris Corner Detector

Credit: R. Szeliski

( , ) ,u

E u v u v Mv

Intensity change in shifting window: eigenvalue analysis

1, 2 – eigenvalues of M

direction of the

slowest change

direction of the

fastest change

(max)-1/2

(min)-1/2

Ellipse E(u,v) = const

Harris Corner Detector

Credit: R. Szeliski

1 and 2 both large

Image patch

SSD surface

Selecting Good Features

Credit: C. Dyer

large 1, small 2

SSD surface

Selecting Good Features

Credit: C. Dyer

small 1, small 2

SSD surface

Selecting Good Features

Credit: C. Dyer

1

2

“Corner”

1 and 2 both large,

1 ~ 2;

E increases in all

directions

1 and 2 are small;

E is almost constant

in all directions

“Edge”

1 >> 2

“Edge”

2 >> 1

“Flat”

region

Classification of

image points using

eigenvalues of M:

Harris Corner Detector

Credit: C. Dyer

Harris Corner Detector

Measure of corner response:

( )2

det traceR M k M= −

1 2

1 2

det

trace

M

M

=

= +

k is an empirically-determined constant; e.g., k = 0.05

Credit: C. Dyer

Harris Corner Detector

1

2 “Corner”

“Edge”

“Edge”

“Flat”

• R depends only on

eigenvalues of M

• R is large for a corner

• R is negative with large

magnitude for an edge

• |R| is small for a flat

region

R > 0

R < 0

R < 0|R| small

Credit: C. Dyer

Harris Corner Detector: Algorithm

Algorithm:

1. Find points with large corner

response function R

(i.e., R > threshold)

2. Take the points of local maxima

of R (for localization) by non-

maximum suppression

Credit: C. Dyer

Harris Detector: Example

Credit: C. Dyer

Compute corner response R = 12 – k(1 + 2)2

Harris Detector: Example

Credit: C. Dyer

Harris Detector: Example

Find points with large corner response: R > thresholdCredit: C. Dyer

Take only the points of local maxima of R

Harris Detector: Example

Credit: C. Dyer

Harris Detector: Example

Credit: C. Dyer

Interest points extracted with Harris (~ 500 points)

Harris Detector: Example

Credit: C. Dyer

Harris Detector: Example

Credit: C. Dyer

Harris Detector: Summary

Average intensity change in direction [u,v] can be

expressed in bilinear form:

Describe a point in terms of eigenvalues of M:

measure of corner response:

A good (corner) point should have a large intensity change in all directions, i.e., R should be a large

positive value

( , ) ,u

E u v u v Mv

( )2

1 2 1 2R k = − +

Credit: C. Dyer

Harris Detector Properties

Rotation invariance

Ellipse rotates but its shape (i.e., eigenvalues)

remains the same

Corner response R is invariant to image rotation

Credit: C. Dyer

But not invariant to image scale

Fine scale: All points will

be classified as edges

Coarse scale: Corner

Harris Detector Properties

Credit: C. Dyer

Harris Detector Properties

Quality of Harris detector for different scale

changes

Repeatability rate:

# correct correspondences

# possible correspondences

C. Schmid et al., “Evaluation of Interest Point Detectors,” IJCV 2000

Credit: C. Dyer

47

Invariant Local Features

Goal: Detect the same interest points

regardless of image changes due to

translation, rotation, scale, viewpoint

48

Geometry◼ Rotation

◼ Similarity (rotation + uniform scale)

◼ Affine (scale dependent on direction)

valid for: orthographic camera, locally planar

object

Photometry◼ Affine intensity change (I → a I + b)

Models of Image Change

Credit: C. Dyer

SIFT Detector [Lowe ’04]

Difference-of-Gaussian (DoG)

is an approximation of the

Laplacian-of-Gaussian (LoG)

− =

Lowe, D. G., “Distinctive Image Features from Scale-Invariant Keypoints”, International Journal of Computer Vision, 60, 2, pp. 91-110, 2004Credit: C. Dyer

SIFT Detector

Credit: C. Dyer

SIFT Detector

Credit: C. Dyer

SIFT Detector Algorithm Summary

Detect local maxima in

position and scale of

squared values of

difference-of-Gaussian

Fit a quadratic to

surrounding values for

sub-pixel and sub-

scale interpolation

Output = list of (x, y, )

points

Blur

Resample

Subtract

Credit: C. Dyer

References on Feature Descriptors

A performance evaluation of local descriptors, K.

Mikolajczyk and C. Schmid, IEEE Trans. PAMI 27(10),

2005

Evaluation of features detectors and descriptors

based on 3D objects, P. Moreels and P. Perona, Int. J. Computer Vision 73(3), 2007

Credit: C. Dyer

Student paper presentation

54

Color Harmonization

D. Cohen-Or, O. Sorkine, R. Gal, T. Leyv, and, Y. Xu.

ACM SIGGRAPH 2006

Presenter: Chen, Aihua

Next Time

Panorama

◼ Feature matching

Student paper presentations◼ 04/28: Crocker, Orion

Color Conceptualization. X. Hou and L. Zhang.

ACM Multimedia 2007

◼ 04/28: Dimaggio, Antonio

Colorization Using Optimization. A. Levin, D. Lischinski,

Y. Weiss. ACM SIGGRAPH 2004

◼ 04/30: Everett, Riley

Photographic tone reproduction for digital images.

E. Reinhard, M. Stark, P. Shirley, and J. Ferwerda, SIGGRAPH 2012

◼ 04/30: Fan, Yubin

Burst photography for high dynamic range and low-light imaging on mobile

cameras. Samuel W. Hasinoff, Dillon Sharlet, Ryan Geiss, Andrew Adams,

Jonathan T. Barron, Florian Kainz, Jiawen Chen, and Marc Levoy. SIGGRAPH

Asia 2016 55

Recommended