keypoint detection: harris operator · 2012-02-06 · harris corner detector • algorithm steps:...

21
Keypoint Detection: Harris Operator Guido Gerig CS 6320 Spring 2012 Credits: Ross Whitaker, Trevor Darrell, Lana Lazebnik, K. Grauman, B. Leibe, A. Efros

Upload: others

Post on 04-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Keypoint Detection: Harris Operator

Guido Gerig

CS 6320 Spring 2012

Credits: Ross Whitaker, Trevor Darrell, Lana Lazebnik, K. Grauman, B. Leibe,

A. Efros

Page 2: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Keypoint Detection

• Where will the interest points come from?

– What are salient features that we’ll detect in

multiple views?

• How to describe a local region?

• How to establish correspondences, i.e.,

compute matches?

Credit: Prof. Trevor Darrell, C280 Computer Vision, Lecture 6

[email protected]

Page 3: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find
Page 4: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Finding Corners

Key property: in the region around a corner,

image gradient has two or more dominant

directions

Corners are repeatable and distinctive

C.Harris and M.Stephens. "A Combined Corner and Edge Detector.“ Proceedings of the 4th Alvey Vision Conference: pages 147--151.

Source: Lana Lazebnik

Page 5: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Corners as distinctive interest points

We should easily recognize the point by looking through a small window

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

“edge”:

no change

along the edge

direction

“corner”:

significant

change in all

directions

“flat” region:

no change in

all directions

Source: A. Efros

Page 6: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Local neighborhoods of 3 distinctive local patterns: Strong point features (points, corners) represent good landmarks.

Page 7: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Harris Detector formulation

2

,

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

E u v w x y I x u y v I x y

Change of intensity for the shift [u,v]:

Intensity Shifted intensity

Window function

or Window function w(x,y) =

Gaussian 1 in window, 0 outside

Source: R. Szeliski

Page 8: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Harris Detector formulation

This measure of change can be approximated by:

2

2,

( , )x x y

x y x y y

I I IM w x y

I I I

where M is a 22 matrix computed from image derivatives:

v

uMvuvuE ][),(

M

Sum over image region – area

we are checking for corner

Gradient with

respect to x,

times gradient

with respect to y

Page 9: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Harris Detector formulation

2

2,

( , )x x y

x y x y y

I I IM w x y

I I I

where M is a 22 matrix computed from image derivatives:

Sum over image region – area

we are checking for corner

Gradient with

respect to x,

times gradient

with respect to y

M

Page 10: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

First, consider an axis-aligned corner:

What does this matrix reveal?

Page 11: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

2

1

2

2

0

0

yyx

yxx

III

IIIM

First, consider an axis-aligned corner:

This means dominant gradient directions align with

x or y axis

If either λ is close to 0, then this is not a corner, so

look for locations where both are large.

Slide credit: David Jacobs

What does this matrix reveal?

What if we have a corner that is not aligned with the

image axes?

Page 12: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Arbitrary rotation

2

2

yyx

yxx

III

IIIM

• M arbitrary, positive semidefinite • Edges and corner no more aligned

with image axes

Page 13: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

General Case

Since M is symmetric, we have

(eigenvalue-eigenvector transformation) RRM

2

11

0

0

We can visualize M as an ellipse with axis

lengths determined by the eigenvalues and

orientation determined by R

direction of the

slowest change

direction of the

fastest change

(max)-1/2

(min)-1/2

Slide adapted form Darya Frolova, Denis Simakov.

Page 14: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Interpreting the eigenvalues

1

2

“Corner”

1 and 2 are 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:

Edge (strong response

across edge, small

response along edge):

λ1 >> λ2 or λ2 >> λ1

Corner (strong responses

in both directions):

λ1 and λ2 >> 0

Flat (small or no response

in both directions):

λ1 and λ2 small

Page 15: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Corner response function: Harris

“Corner”

R > 0

“Edge”

R < 0

“Edge”

R < 0

“Flat”

region

|R| small

2

2121

2 )()(trace)det(Response MM

α: constant (0.04 to 0.06)

Page 16: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Harris Corner Detector

• Algorithm steps:

– Compute M matrix within all image windows to get

their Response scores

– Find points with large corner response

(Response > threshold)

– Take the points of local maxima of Response

(search local neighborhoods, e.g. 3x3 or 5x5 for

location of maximum response).

Page 17: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Harris Detector: Workflow

Slide adapted form Darya Frolova, Denis Simakov, Weizmann Institute.

Page 18: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Harris Detector: Workflow Compute corner response R

Page 19: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Harris Detector: Workflow Find points with large corner response: R>threshold

Page 20: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Harris Detector: Workflow Take only the points of local maxima of R

Page 21: Keypoint Detection: Harris Operator · 2012-02-06 · Harris Corner Detector • Algorithm steps: –Compute M matrix within all image windows to get their Response scores –Find

Harris Detector: Workflow