64
GV12/3072 Image Processing. 1 Corner Detection

Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

  • Upload
    hakhue

  • View
    222

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

1

Corner Detection

Page 2: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

Last Week

GV12/3072Image Processing.

2

Page 3: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

3

Outline• Corners and point features• Moravec operator• Image structure tensor• Harris corner detector• Sub-pixel accuracy• SUSAN• FAST• Example descriptor: SIFT

Page 4: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

4

Point Features (a.k.a. Corners or Interest Points)

• Many applications need to match corresponding points in images.

• Stereo matching and 3D reconstruction• Tracking• Localization• Recognition

• Points along lines are poorly defined– See Aperture Problem phenomenon (next)

Page 5: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •
Page 6: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •
Page 7: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

9

Tracking & Reconstruction

• 2D3 Commercial application: Boujou– Match-moving for special effects– Computes a point-cloud + camera poses

• UNC city-scanning (video) (Pollefeys et al.)

Page 8: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

Feature matching vs. tracking

Extract features independently and then match by comparing descriptors

Extract features in first images and then try to find same feature back in next view

What is a good feature?

Image-to-image correspondences are key to passive triangulation-based 3D reconstruction

From Marc Pollefeys

Page 9: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

11

Stereo Example

Page 10: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

12

Stereo Example

Page 11: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

13

“Corner” Interest Points• We want corner points that are:

• Distinctive• Stable from image to image• (Sparse) ?

• And are invariant to:• View point (scale, orientation, translation)• Lighting conditions• Object deformations• Partial occlusion

• And are, if possible,• Geometrically meaningful, though not necessarily

scene-object corners.

Page 12: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

14

Intersections

• Edge and line intersections provide recognizable features

Intersections can be stable or unstable

Page 13: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

15

Moravec “Interest” Operator

• Use a window surrounding each pixel as its own matching template

• Tests local autocorrelation of the image: – SSD = Sum of Squared Differences

• Good matches in any direction• Flat image region

• Good matches in only one direction• Linear feature or edge

• No good matches in any direction• Distinctive point feature• Corner point

Page 14: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

Neighborhood stands out?

GV12/3072Image Processing.

17

Page 15: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

sum(sum( (patch - Ipad(rowStart:rowStart+2, colStart:colStart+2) ).^2 ));18

Check SSDs

Page 16: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

19

1.34

1.04

2.39

1.14 2.12

0

2.46

2.6 1.79

2.34

3.24

0.60

Check SSDs

Page 17: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

20

Implementation

• Match quality for displacements (∆x, ∆y) uses L2 norm:

• w is a window function– e.g. constant or Gaussian

• Cornerness is min ε over the eight-neighbourhood N, excluding (0, 0)

( )∑∈

−Δ+Δ+=ΔΔ0at centered I, of)3,3(),(

2),(),(),(),(pNyx

yxIyyxxIyxwyxε

Page 18: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

21

Moravec “Interest” Operator

• Use a window surrounding each pixel as its own matching template T.

• Tests local autocorrelation of the image: SSD• Good matches in any direction

• Flat image region

• Good matches in only one direction• Linear feature or edge

• No good matches in any direction• Distinctive point feature• Corner point

Page 19: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

22

Cornerness

• Using 7x7 matching window.

Page 20: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

23

Cornerness distribution

# Pixels

Cornerness

Page 21: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

24

Non-maximal suppression

• Set pixels that have an 8 neighbour with higher cornerness to zero.

Page 22: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

25

Threshold T = 1

Page 23: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

26

Threshold T = 2

Page 24: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

27

Threshold T = 3

Page 25: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

Non-max Suppression Efficiently?

28

Input, I(this time, pretend these are cornerness values)

Page 26: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

Non-max Suppression by Dilation?

30

Input, I(this time, pretend these are cornerness values)

imdilate(I, ones(3,3))

Page 27: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

31

Moravec Algorithm Summary

• Enhance corner features• Non-maximal suppression• Threshold

Page 28: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

32

Problems

• Multiple responses at high interest points• Extend non-maximal suppression to windows

• Weak response to “blurred” corners

• Slow

Page 29: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

General Form

Can we do better? Derive general theory of “cornerness”

33

( )∑∈

−Δ+Δ+=ΔΔ0at centered I, of)3,3(),(

2),(),(),(),(pNyx

yxIyyxxIyxwyxε

( ) xx Syx

III

IIIyxyx T

yyx

yxx=⎟

⎞⎜⎝

⎛⎟⎟

⎜⎜

⎛= 2

2

,),(ε

Page 30: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

(See online Taylor series expansion/approximation)

GV12/3072Image Processing.

35

Page 31: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

36

Analytic Expansion

• Taylor expansion of I(x + u, y + v) and substitution into ε gives:

• <…> denotes average over the window N.• S is the image structure tensor

( ) xx Syx

III

IIIyxyx T

yyx

yxx=⎟

⎞⎜⎝

⎛⎟⎟

⎜⎜

⎛= 2

2

,),(ε

Page 32: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

37

Structure tensor

• S captures the curvature of the local autocorrelation surface

• The eigenvalues are the principal curvatures

• They are the solutions to

( ) 0222222 =−++− yxyxyx IIIIIIλλ

Page 33: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

Principal Axes (i.e. Eigenvectors)(Note: see Simon Prince’s SVD slides online)

38

homogeneous

edge

corner

i.e. maximize smallest eigenvalue of S

From Marc Pollefeys

Page 34: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

40

Harris Corner Detector

• Defines cornerness as size of smallest eigenvalue, or

• Non-maximal suppression and thresholding as before

( ))/(

/

)(Tr/)det(

2121

22222

λλλλ +=

+⎟⎠⎞⎜

⎝⎛ −=

=

C

IIIIIIC

SSC

yxyxyx

(Example Video)

Page 35: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

41

Cornerness and NMS

Page 36: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

42

Sigma = 1, Threshold T=0.1

Page 37: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

43

Sigma = 1, Threshold T=0.15

Page 38: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

44

Sigma = 1, Threshold T=0.2

Page 39: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

45

Variants

• Can include Gaussian smoothing when computing Ix and Iy.

• Less important than for edge detection.• Helps eliminate multiple responses to the same corner• Similar effect using larger regions in non-maximal suppression

• Harris and Stephens combined edge and corner detector

• Various other corner measures, thresholding schemes, non-max suppression techniques

• 0<k<0.25 to get the desired behaviour from R:– positive at corners and negative at edges

)(Tr)det( 2 SkSR −=

Page 40: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

46

Sigma = 5, Threshold T=0.001

Page 41: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

47

Sigma = 5, Threshold T=0.004

Page 42: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

48

Sigma = 5, Threshold T=0.007

Page 43: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

49

Harris and Stephens

k = 0.02

Harris and Stephens, Proc. 4th Alvey Vision Conference, 147-151, 1988.

Page 44: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

53

SUSAN

• Method for edge and corner detection• No image derivatives• Insensitive to noise

• Smith et al, IJCV, 23(1):45-78, 1997

Page 45: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

54

USAN

“Univalue Segment Assimilating Nucleus”

It is the portion of the template with intensity within a threshold of the “nucleus”.

Page 46: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

55

Edges and Corners

• In flat regions the USAN has similar area to the template

• At edges the USAN area is about half the template area

• At corners the USAN area is smaller than half the template area.

• “SUSAN” = Smallest USAN.

Page 47: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

56

Example

Page 48: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

57

Implementation

• Circular mask C with radius 3.4 (|C| = 37 pixels).

• The nucleus is the centre pixel r0.

⎩⎨⎧ <−

=otherwise 0

)()( 1),( 0

0trIrI

rru ∑∈

=)(

00

),(rCr

rrun

⎩⎨⎧ <−

=otherwise 0

)( 0

TnnCrA

T=3|C|/4 for edge detection

T=|C|/2 for corner detection

Select t by considering image noise level.

001110001111101111111

C=1111111111111101111100011100

Page 49: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

58

Refinements

• ‘Band’ edge orientation from USAN moments:

• Step edge orientation from centre of gravity.

• Eliminate false positive corners using• Distance of USAN centre of gravity from r0.• Connectivity of USAN.

• Non-maximal suppression

( )02201 /tan μμ−

Page 50: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

FASTMachine learning for high-speed corner detection

Rosten & Drummond, ECCV 2006

• Reuse nucleus concept – From Trajkovic & Hedley’98

• Machine learning to train it to be fast

• Retain performance

GV12/3072Image Processing.

59

Page 51: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

Trajkovic & Hedley• P and P’ are opposite points, diameter D

apart

GV12/3072Image Processing.

60

From Rosten & Drummond

Page 52: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

FAST• Set of n contiguous pixels in the circle

which are all brighter / darker by some T?– n = 12?

GV12/3072Image Processing.

61

Page 53: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

• For each location (1-16) on the circle x, the pixel at that position relative to p (denoted by p x) can have one of three states:

GV12/3072Image Processing.

62

Train decision tree to maximize information gain:

Page 54: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

FAST Performance

• On average, 2.26 (for n = 9) and 2.39 (for n = 12) questions are asked per pixel to determine whether or not it is a feature. By contrast, the handwritten detector asks on average 2.8 questions. 63

Page 55: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

64

SIFT

• Scale Invariant Feature Transform.• Detects “scale-space extrema”.• Highly stable features• Now widely used in computer vision.

• D.G. Lowe, IJCV Vol. 60(2) 91-110 2004.

Page 56: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

65

SIFT Application: Autostitch

Page 57: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

66

DoG Scale Space

Subtract

…Efficiently computed Laplacian scale space.

Page 58: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

67

Scale space extrema

• Find local maxima and minima in the scale space stack.

• These are SIFT keypoints.

Page 59: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

68

SIFT Keypoints

Page 60: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

69

Threshold local variance

• Keep the top 50 %.

• Notice the response along edges.

Page 61: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

70

Threshold Harris cornerness

Lowe thresholds a cornerness measure in the scale space.

Page 62: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

71

SIFT Features

• Extrema in Laplacian are distinctive (after removing edges)

• Extrema in scale space give scale independence.

• Lowe creates features at each keypoint from the histogram of local edge orientations

• Very stable features for affine matching

Page 63: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

72

Evaluation of Interest-point Detectors?

• Ideas?

• Innovations?

Page 64: Corner Detection - UCL Computer Science - Many applications need to match corresponding ... • Method for edge and corner detection ... • Now widely used in computer vision. •

GV12/3072Image Processing.

73

Summary• Corners and point features• Various algorithms

• Moravec• Harris (image structure tensor)• Sub-pixel accuracy• SUSAN• FAST

• Example descriptor: SIFT