feature point matching

55
(1) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php Feature Point Matching Detection, Extraction & Matching

Upload: trynt

Post on 19-Jan-2016

70 views

Category:

Documents


6 download

DESCRIPTION

Feature Point Matching. Detection, Extraction & Matching. Contents. Feature point matching What is it? What is it for? Feature point detection Moravec feature point detector Harris corner detector Scale space detection Feature point extraction & matching Matching using templates - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Feature Point Matching

(1) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature Point Matching

Detection, Extraction & Matching

Page 2: Feature Point Matching

(2) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Contents● Feature point matching

What is it?

What is it for?

● Feature point detection

Moravec feature point detector

Harris corner detector

Scale space detection

● Feature point extraction & matching

Matching using templates

● Cross-correlation● Problems

Other possibilities

● Summary

Page 3: Feature Point Matching

(3) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point matching

● Feature Point:

A point on an image that is useful for image processing (by human or computer) because of the local properties in the image in the neighbourhood of the point.

● One thing a feature point might be useful for is matching.

● The matching process in general has 3 steps:

Feature point detection Feature point extraction Feature point matching

Also motion estimation & salience maps (previous lectures)

Page 4: Feature Point Matching

(4) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point matching

● Useful for

Object tracking Motion detection Object recognition Multi-view reconstruction

● Stereo+ vision● Structure from motion

Image stitching Localisation Simultaneous Localisation And Mapping

Page 5: Feature Point Matching

(5) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point matching

● Useful for

Object tracking● Useful for 3D localisation● Resistant to occlusion (local features)● Resistant to clutter (local features)

Motion detection● Defeats aperture problem (distinctive features)

Page 6: Feature Point Matching

(6) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point matching - phases

1. Feature Point Detection: The process of finding such useful points in an image in the first

place. One common example is the Harris “Corner Detector”.

2. Feature Point Extraction: The process of finding a description of the local properties of an

image (its features) around a feature point (this might just be a patch extracted from the image).

3. Feature Point Matching: The process of using the local properties of images around feature

points to identify the points across images that refer to the same points in the world

Page 7: Feature Point Matching

(7) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Matching between images

Extraction

Page 8: Feature Point Matching

(8) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Matching between images

Matching

Page 9: Feature Point Matching

(9) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Matching to a known textured object

Extraction

Page 10: Feature Point Matching

(10) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Matching to a known textured object

Matching

Page 11: Feature Point Matching

(11) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection

● Probably because it is not so well defined, feature point detection is an unsolved problem.

Change the matching method, and the criteria for a good feature point changes.

● May detection methods exist. Some examples are: Moravec (1977)

Harris (1988)

Scale space extrema (1999)

● Often conceptualised as a search for a generalised “corner”, but other definitions work!

Page 12: Feature Point Matching

(12) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection

● General Desiderata

Points repeatably detectable under transforms Computationally efficient Easily localisable High detection rate Robust to noise

● Useful for

Finding candidates for point matching Creating salience maps (see previous lecture on attention)

Page 13: Feature Point Matching

(13) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

● Recall Moravec point detector Used on the Stanford Cart in the 70s.

At each pixel an interest score is calculated and local maxima in this score are used (i.e. where the score at a pixel is higher than in all other pixels in the neighbourhood).

This score at a point is the change in intensity around the point in the direction that the intensity changes slowest – BUT you only check 4 key directions around the point.

Page 14: Feature Point Matching

(14) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

● Recall Moravec point detector

Here is how to calculate the interest score:

Where P is the set of perturbations ● { (-1,1),(0,1),(1,0),(1,1)}

W is the local window. I image intensity. x, y, u, v pixel indices.

Example to follow.

})],(),([{min),(2

,,

WyxPvu

yxIyvxuIyxScore

Page 15: Feature Point Matching

(15) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

• Moravec point detector

Local WindowW(x,y)

Shifted WindowW(x+1,y+1)

Sum = (1-0)^2 +(0-1)^2 +(1-1)^2 +(0-0)^2 +(0-1)^2 +(1-1)^2 +(1-1)^2 +(1-1)^2 +(1-1)^2= 3

4

})],(),([{min),(2

,,

WyxPvu

yxIyvxuIyxScore

Page 16: Feature Point Matching

(16) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

• Moravec point detector

Local WindowW(x,y)

Shifted WindowW(x,y-1)

Sum = (1-1)^2 +(1-0)^2 +(0-1)^2 +(1-0)^2 +(0-0)^2 +(0-1)^2 +(1-1)^2 +(1-1)^2 +(1-1)^2= 4

4 3

})],(),([{min),(2

,,

WyxPvu

yxIyvxuIyxScore

Page 17: Feature Point Matching

(17) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

• Moravec point detector

Shifted Windows

3

Minimum = 3

3

4 3

})],(),([{min),(2

,,

WyxPvu

yxIyvxuIyxScore

Page 18: Feature Point Matching

(18) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

• Moravec point detector

})],(),([{min),(2

,,

WyxPvu

yxIyvxuIyxScore

Minimum = 3

Page 19: Feature Point Matching

(19) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

• Moravec point detector

32

3

0001

000001110

000

000

110

000

000

011

000

000

000

00 0011 11

0000

10

000

11 3

1 2

})],(),([{min),(2

,,

WyxPvu

yxIyvxuIyxScore

Page 20: Feature Point Matching

(20) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

• Moravec point detector

Thresholding...323

})],(),([{min),(2

,,

WyxPvu

yxIyvxuIyxScore

2 3

Page 21: Feature Point Matching

(21) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

• Moravec point detector

Performing non-maximal suppression...

3

})],(),([{min),(2

,,

WyxPvu

yxIyvxuIyxScore

3 3

Page 22: Feature Point Matching

(22) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

• Moravec point detector

Corner points!

})],(),([{min),(2

,,

WyxPvu

yxIyvxuIyxScore

Page 23: Feature Point Matching

(23) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection

● Moravec point detector

Fast Terrible with angles away from 45 deg Has problems with noise Not invariant to scale Not invariant to rotation In other words, obsolete.

● More robust detectors exist.

Page 24: Feature Point Matching

(24) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

● Moravec point detector

Terrible with angles away from 45 deg

21 0

1212

1

• Lots of false matches away from the diagonal. 0

00

00

Page 25: Feature Point Matching

(25) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

● Moravec point detector

Has problems with noise.

0 1 20 1 0 022

Page 26: Feature Point Matching

(26) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection - Moravec

● Moravec point detector ● Implicit assumption is that points of interest

are points where the image brightness changes fast in all directions.

● More recent approaches have attempted to create better detectors, incorporating the same basic assumption.

● But without the limitation of 4 cardinal directions.

Page 27: Feature Point Matching

(27) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – Harris

● The Harris detector generalises the Moravec detector:

1.Attempting to calculate the strength of image change in a window in the direction of largest change and of smallest change (rather than in 4 principal directions, which allows for better rotational invariance)

2.Using a circular gaussian window rather than a square one (less noise)

3.Taking into account both the direction of minimum change in brightness and maximum change in brightness (to reduce the probability of picking up edges).

Page 28: Feature Point Matching

(28) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – Harris

● The Harris detector generalises the Moravec detector:

Strength of fastest change

Strength of slowest change

Strength in direction of slowest change is low

Strength in direction of fastest change is high...

...so this must be an edge pixel!

Page 29: Feature Point Matching

(29) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – Harris

● How to calculate these strengths?

Estimate the

X and Y gradients

for all pixels in the region of your point of interest.

(this can be done efficiently by convolution with a small mask

e.g a sobel mask:)

-2

-1-1

-4

-2 3-3

4

4

1-3

-1

-2 10

0-3

-1-2

-1

-2

-1

0

0

0

1

2

1

1

0

-1

2

0

-2

1

0

-1x

I

y

I

Page 30: Feature Point Matching

(30) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – Harris

● How to calculate these strengths?

The sum of squares of these values will give us an idea of the strength of change in the x direction.

The sum of squares of these values will give us an idea of the strength of change in the y direction.

-2

-1-1

-4

-2 3-3

4

4

1-3

-1

-2 10

0-3

-1-2

x

I

y

I

Page 31: Feature Point Matching

(31) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – Harris

● How to calculate these strengths?

-2

-1-1

-4

-2 3-3

4

4

1-3

-1

-2 10

0-3

-1-2

Very similar to the Moravec operator… which wasn’t good enough for us!

We need a way to calculate the strength of change in the directions of maximum & minimum change.

The sum of squares of these values will give us an idea of the strength of change in the x direction.

The sum of squares of these values will give us an idea of the strength of change in the y direction.

Page 32: Feature Point Matching

(32) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – Harris

● How to calculate these strengths?

With:

Check the following special cases:

- it’s the same as Moravec’s!

122 yx

}0,1{ yx }1,0{ yx }2

1,

2

1{ yx }

2

1,

2

1{ yx

2

),(

W

W yy

Ix

x

Iyxstr

Page 33: Feature Point Matching

(33) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – Harris

● How to calculate these strengths?

● Now we can analyse this matrix:

y

x

y

I

y

I

x

I

y

I

x

I

x

I

yxyxstr

WW

WWW 2

2

),(

WW

WWW

y

I

y

I

x

I

y

I

x

I

x

I

M 2

2

Page 34: Feature Point Matching

(34) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – Harris

● How to calculate these strengths?

● It turns out that if we assume that

then the maxima and minima of this function are the eigenvalues of matrix ,

(* how to see why?)

y

x

y

I

y

I

x

I

y

I

x

I

x

I

yxyxstr

WW

WWW 2

2

),(

122 yx

WM 21,

Page 35: Feature Point Matching

(35) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – Harris

Now let’s try to calculate MW from our data:

-1

● How to calculate these strengths?

8.13

2.101

2

1

WM

2124

24842

1

Strength of fastest change

Strength of slowest change

Page 36: Feature Point Matching

(36) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – Harris

● How to calculate these strengths?

-2

-1-1

-4

-2 3-3

4

4

1-3

-1

-2 10

0-3

-1-2

We sum up the gradients for all nearby pixels, weighted by distance.

Usually we use a circular gaussian window when summing to create our matrix MW.

WW

WW

WW

WW

y

Ig

y

I

x

Ig

y

I

x

Ig

x

Ig

2

2

Page 37: Feature Point Matching

(37) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

● How to calculate these directions?

● Actually, because it is only the relationship between the eigenvalues that is of interest, and not the values themselves, the eigenvalues of M are usually not computed directly. Instead the interest score is computed:

● Where k is some constant ~ 0.04.

Feature point detection – Harris

2)trace()det(),( WW MkMyxScore

Page 38: Feature Point Matching

(38) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – Harris

● The Harris detector generalises the Moravec detector:

• Moravec did not generalise to non-cardinal directions but the Harris operator does.

Generalisations of the Harris detector exist too, for larger stability with scaling (generally using pyramidal images).

Page 39: Feature Point Matching

(39) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – Harris

● The Harris detector has problems with scale changes

Where is the interest point really?Up close

From afar

Page 40: Feature Point Matching

(40) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● Before getting into scale-space detection, recall your use of Difference of Gaussian (DoG) filters in salience maps - also often used is the very similar Laplace of Gaussian (LoG).

● It turned out that these were useful filters for finding the salience of each point in an image.

● Zero crossings in images filtered with DoG/LoG can also be used for finding edges.

● LoG/DoG are also useful for finding interest points.

Page 41: Feature Point Matching

(41) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● Here is an image

● Here is the DoG of that image

Page 42: Feature Point Matching

(42) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● Local maxima and minima in the DoG image correspond to interesting points in our original image…

● This is a new definition of interest point: DoG extrema.

● …i.e. points that have a larger or lower DoG response than all their neighbours.

Page 43: Feature Point Matching

(43) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● DoG extrema are about as good as Harris points:

they are resistant to rotation (since the filter is rotationally invariant)

they are relatively resistant to noise (because they are the response of a smooth filter)

● BUT:

Like Harris points they are not robust to changes in scale.

Page 44: Feature Point Matching

(44) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● Problems with scaling motivate another concept – that of scale space.

● The concept of scale space motivates another tentative definition for feature points – DoG scale space extrema.

Page 45: Feature Point Matching

(45) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● Let us examine this notion of scale space.

Page 46: Feature Point Matching

(46) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

Image FunctionGaussian Function

),( yxI

● Let us examine this notion of scale space.

2)22( 222

1),,(

vx

eyxG

Gaussian Scale Space

* the star here is convolution

),(),,(),,( yxIyxGyxL

Page 47: Feature Point Matching

(47) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● Let us examine this notion of scale space.

Gaussian Scale Space

* the star here is convolution

),(),,(),,( yxIyxGyxL

Page 48: Feature Point Matching

(48) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● Let us examine this notion of scale space extrema.

* the star here is convolution

The scale space extrema of interest to us are maxima and minima

in the DoG scale space function.

Difference of Gaussian Scale Space Function

),()),,(),,((),,( yxIyxGkyxGyxD

Equivalent Form – Difference of Gaussian Scale Space Function(sometimes faster to compute)

),,(),,(),,( yxLkyxLyxD

Page 49: Feature Point Matching

(49) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● Here is the scale space function for the DoG function...

Difference of Gaussian Scale Space Function

),()),,(),,((),,( yxIyxGkyxGyxD

Page 50: Feature Point Matching

(50) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● Local extrema can be found by checking all pixels in the neighbourhood of each candidate pixel.

Page 51: Feature Point Matching

(51) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● Local extrema can be found by checking all pixels in the neighbourhood of each candidate pixel.

Lets check for interest points hereHigher value

Lower value

Therefore our candidate point is not a local extrema

Page 52: Feature Point Matching

(52) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● Local extrema can be found by checking all pixels in the neighbourhood of each candidate pixel.

Lets check for interest points hereBut no nearby higher value

Lower value

Therefore our candidate point is a local extrema

Page 53: Feature Point Matching

(53) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point detection – scalespace

● Local extrema can be found by checking all pixels in the neighbourhood of each candidate pixel.

Local Extrema from Difference of Gaussian Scale Space Function

),()),,(),,((),,( yxIyxGkyxGyxD

Page 54: Feature Point Matching

(54) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Feature point extraction

● Once a feature-point has been detected, but before we attempt to match it we may decide to process it (this is dubbed feature point extraction) to enable more efficient and more general matching. For example: Extract a colour histogram from the image in the

neighbourhood of the feature-point. Extract a histogram of local gradients from the image in the

neighbourhood of the feature-point. Rotationally pre-align the image in the neighbourhood of the

feature-point according to some criteria. And so forth. “Local Patch”

Page 55: Feature Point Matching

(55) Feature-point matching by D.J.Duff for CompVis 2007.11.15 Online: http://www.cs.bham.ac.uk/~djd/publications.php

Some further reading● Feature points:

Trucco, E. & Verri, A. (1998). Introductory techniques for 3D computer vision. Section 4.3.

Demo: http://www.cim.mcgill.ca/~dparks/CornerDetector/mainApplet.htm

More: http://homepages.inf.ed.ac.uk/cgi/rbf/CVONLINE/entries.pl?TAG378

● Cross-correlation & template matching:

Russ, J.C. (2002). The image processing handbook, 4th Ed. Chapter 10.

Demo: http://bigwww.epfl.ch/demo/templatematching/index.html

More: http://homepages.inf.ed.ac.uk/cgi/rbf/CVONLINE/entries.pl?TAG350

● SIFT:

Lowe, D.G. (2004). Distinctive image features from scale-invariant keypoints. International Journal of Computer Vision, 60(2). Pages 91-110. Available Online

Implementations: http://people.csail.mit.edu/albert/ladypack/wiki/index.php/Known_implementations_of_SIFT

More: http://www.google.com/