Professional Documents
Culture Documents
Corner Detection: GV12/3072 Image Processing. 1
Corner Detection: GV12/3072 Image Processing. 1
GV12/3072 1
Image Processing.
Last Week
GV12/3072 2
Image Processing.
Outline
• Corners and point features
• Moravec operator
• Image structure tensor
• Harris corner detector
• Sub-pixel accuracy
• SUSAN
• FAST
• Example descriptor: SIFT
GV12/3072 3
Image Processing.
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
GV12/3072 4
Image Processing.
Tracking & Reconstruction
• 2D3 Commercial application: Boujou
– Match-moving for special effects
– Computes a point-cloud + camera poses
GV12/3072 9
Image Processing.
Feature matching vs. tracking
Image-to-image correspondences are key to passive
triangulation-based 3D reconstruction
GV12/3072 11
Image Processing.
Stereo Example
GV12/3072 12
Image Processing.
“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
13
scene-object corners.
Intersections
• Edge and line intersections provide
recognizable features
Intersections can be
stable or unstable 14
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 GV12/3072 15
Image Processing.
Neighborhood
stands out?
GV12/3072 17
Image Processing.
Check SSDs
18
sum(sum( (patch - Ipad(rowStart:rowStart+2, colStart:colStart+2) ).^2 ));
Check SSDs
2.39 0 3.24
19
Implementation
• Match quality for displacements (∆x, ∆y)
uses L2 norm:
ε (Δx, Δy ) = ∑ w( x, y)(I ( x + Δx, y + Δy) − I ( x, y))
2
( x , y )∈N ( 3 , 3 ) of I, centered at p 0
• w is a window function
– e.g. constant or Gaussian
• Cornerness is min ε over the eight-
neighbourhood N, excluding (0, 0)
GV12/3072 20
Image Processing.
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
GV12/3072 21
Image Processing.
Cornerness
• Using 7x7 matching window.
22
Cornerness distribution
# Pixels
23
Cornerness
Non-maximal suppression
24
Threshold T = 1
GV12/3072 25
Image Processing.
Threshold T = 2
GV12/3072 26
Image Processing.
Threshold T = 3
GV12/3072 27
Image Processing.
Non-max Suppression Efficiently?
Input, I
(this time, pretend these
are cornerness values)
28
Non-max Suppression by Dilation?
Input, I
(this time, pretend these
are cornerness values)
imdilate(I, ones(3,3))
30
Moravec Algorithm Summary
• Enhance corner features
• Non-maximal suppression
• Threshold
GV12/3072 31
Image Processing.
Problems
• Multiple responses at high interest points
• Extend non-maximal suppression to windows
• Slow
GV12/3072 32
Image Processing.
General Form
Can we do better? Derive general theory of
“cornerness”
( x , y )∈N ( 3 , 3 ) of I, centered at p 0
⎛ I x2 I x I y ⎞⎛ x ⎞
ε ( x, y ) = ( x, y )⎜ ⎟⎜ ⎟ = xT Sx
⎜ I I I 2y ⎟⎝ y ⎠
⎝ x y ⎠ 33
(See online Taylor series expansion/approximation)
GV12/3072 35
Image Processing.
Analytic Expansion
• Taylor expansion of I(x + u, y + v) and
substitution into ε gives:
⎛ I x2 I x I y ⎞⎛ x ⎞
ε ( x, y ) = ( x, y )⎜ ⎟ ⎜ ⎟ = x T Sx
⎜ I I I 2y ⎟⎝ y ⎠
⎝ x y ⎠
• <…> denotes average over the window N.
• S is the image structure tensor
GV12/3072 36
Image Processing.
Structure tensor
• S captures the curvature of the local
autocorrelation surface
• The eigenvalues are the principal curvatures
GV12/3072 37
Image Processing.
Principal Axes (i.e. Eigenvectors)
(Note: see Simon Prince’s SVD slides online)
homogeneous
edge
corner
41
Sigma = 1, Threshold T=0.1
GV12/3072 42
Image Processing.
Sigma = 1, Threshold T=0.15
GV12/3072 43
Image Processing.
Sigma = 1, Threshold T=0.2
GV12/3072 44
Image Processing.
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
2
• R = det( S ) − kTr ( S )
• Various other corner measures, thresholding
schemes, non-max suppression techniques
• 0<k<0.25 to get the desired behaviour from R:
45
– positive at corners and negative at edges
Sigma = 5, Threshold
T=0.001
GV12/3072 46
Image Processing.
Sigma = 5, Threshold
T=0.004
GV12/3072 47
Image Processing.
Sigma = 5, Threshold
T=0.007
GV12/3072 48
Image Processing.
Harris and Stephens
k = 0.02
GV12/3072 53
Image Processing.
USAN
“Univalue Segment
Assimilating
Nucleus”
GV12/3072 54
Image Processing.
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.
GV12/3072 55
Image Processing.
Example
GV12/3072 56
Image Processing.
0011100
Implementation
0111110
1111111
C=1111111
1111111
• Circular mask C with radius 3.4 0111110
(|C| = 37 pixels). 0011100
• The nucleus is the centre pixel r0.
⎧1 I ( r ) − I ( r0 ) < t
u( r, r0 ) = ⎨
n= ∑
u( r, r0 )
⎩0 otherwise r∈C ( r0 )
T=3|C|/4 for edge detection
⎧C − n n < T T=|C|/2 for corner detection
A( r0 ) = ⎨
⎩0 otherwise Select t by considering image
GV12/3072 57
Image Processing. noise level.
Refinements
• ‘Band’ edge orientation from USAN moments:
tan −1 (μ20 / μ02 )
• Step edge orientation from centre of gravity.
GV12/3072 58
Image Processing.
FAST
Machine learning for high-speed corner detection
Rosten & Drummond, ECCV 2006
• Reuse nucleus concept
– From Trajkovic & Hedley’98
• Retain performance
GV12/3072 59
Image Processing.
Trajkovic & Hedley
• P and P’ are opposite points, diameter D
apart
GV12/3072 60
Image Processing.
From Rosten & Drummond
FAST
• Set of n contiguous pixels in the circle
which are all brighter / darker by some T?
– n = 12?
GV12/3072 61
Image Processing.
• 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/3072 62
Image Processing.
FAST Performance
GV12/3072 64
Image Processing.
SIFT Application: Autostitch
GV12/3072 65
Image Processing.
DoG Scale Space
…
Subtract
Efficiently
… computed
Laplacian scale
space.
GV12/3072 66
Image Processing.
Scale space extrema
• Find local
maxima and
minima in the
scale space stack.
• These are SIFT
keypoints.
GV12/3072 67
Image Processing.
SIFT Keypoints
GV12/3072 68
Image Processing.
Threshold local variance
• Keep the
top 50 %.
• Notice the
response
along edges.
GV12/3072 69
Image Processing.
Threshold Harris cornerness
Lowe thresholds a
cornerness
measure in the
scale space.
GV12/3072 70
Image Processing.
SIFT Features
• Extrema in Laplacian are distinctive (after
removing edges)
• Extrema in scale space give scale
independence.
• Innovations?
GV12/3072 72
Image Processing.
Summary
• Corners and point features
• Various algorithms
• Moravec
• Harris (image structure tensor)
• Sub-pixel accuracy
• SUSAN
• FAST
• Example descriptor: SIFT
GV12/3072 73
Image Processing.