Matching Features Matching With Invariant Features: Computational Photography, 6.882 Prof. Bill Freeman
Matching Features Matching With Invariant Features: Computational Photography, 6.882 Prof. Bill Freeman
Matching Features Matching With Invariant Features: Computational Photography, 6.882 Prof. Bill Freeman
1
Matching with Features
•Detect feature points in both images
Matching with Features
•Find corresponding pairs • Problem 1:
•Use these pairs to align images – Detect the same point independently in both
images
no chance to match!
Contents
Selecting Good Features
• Harris Corner Detector
• What’s a “good feature”? – Description
– Satisfies brightness constancy – Analysis
– Has sufficient texture variation
• Detectors
– Does not have too much texture variation
– Rotation invariant
– Corresponds to a “real” surface patch
– Scale invariant
– Does not deform too much over time
– Affine invariant
• Descriptors
– Rotation invariant
– Scale invariant
– Affine invariant
2
The Basic Idea
An introductory example: • We should easily recognize the point by looking
through a small window
Harris corner detector • Shifting a window in any direction should give
a large change in intensity
Contents
Harris Detector: Basic Idea
• Harris Corner Detector
– Description
– Analysis
• Detectors
– Rotation invariant
– Scale invariant
– Affine invariant
“flat” region: “edge”: “corner”: • Descriptors
no change in no change along significant change – Rotation invariant
all directions the edge direction in all directions – Scale invariant
– Affine invariant
E (u, v) = ∑ w( x, y ) [ I ( x + u , y + v) − I ( x, y ) ]
2
x, y
3
Harris Detector: Mathematics Harris Detector: Mathematics
Expanding E(u,v) in a 2nd order Taylor series expansion, we
Intensity change in shifting window: eigenvalue analysis
have,for small shifts [u,v], a bilinear approximation:
⎡u ⎤
⎡u ⎤ E (u, v) ≅ [u , v ] M ⎢ ⎥ λ1, λ2 – eigenvalues of M
E (u, v) ≅ [u , v ] M ⎢ ⎥ ⎣v ⎦
⎣v ⎦
direction of the
fastest change
where M is a 2×2 matrix computed from image derivatives: Ellipse E(u,v) = const direction of the
slowest change
⎡ I 2
IxI y ⎤
M = ∑ w( x, y ) ⎢ x
⎥
(λmax)-1/2
x, y ⎣⎢ I x I y I y2 ⎦⎥ (λmin)-1/2
4
Harris Detector: Mathematics Harris Detector: Mathematics
Measure of corner response: λ2 “Edge” “Corner”
• R depends only on R<0
R = det M − k ( trace M )
2
eigenvalues of M
• R is large for a corner R>0
5
Harris Detector: Workflow Harris Detector: Workflow
Take only the points of local maxima of R
Contents
Harris Detector: Summary • Harris Corner Detector
– Description
• Average intensity change in direction [u,v] can be – Analysis
expressed as a bilinear form: • Detectors
⎡u ⎤
E (u , v) ≅ [u , v ] M ⎢ ⎥
– Rotation invariant
⎣v ⎦ – Scale invariant
– Affine invariant
• Describe a point in terms of eigenvalues of M:
measure of corner response • Descriptors
– Rotation invariant
R = λ1λ2 − k ( λ1 + λ2 )
2
– Scale invariant
• A good (corner) point should have a large intensity change – Affine invariant
in all directions, i.e. R should be large positive
6
Harris Detector: Some Properties Harris Detector: Some Properties
• Partial invariance to additive and multiplicative
• Invariance to image intensity change? intensity changes
9 Only derivatives are used => invariance
to intensity shift I → I + b
9 Intensity scale: I → a I
R R
threshold
Repeatability rate:
# correspondences
# possible correspondences
7
Contents
• Harris Corner Detector
– Description
– Analysis
• Detectors
We want to:
– Rotation invariant
detect the same interest points
– Scale invariant
– Affine invariant
regardless of image changes
• Descriptors
– Rotation invariant
– Scale invariant
– Affine invariant
Contents
Models of Image Change • Harris Corner Detector
– Description
• Geometry
– Analysis
– Rotation • Detectors
– Similarity (rotation + uniform scale) – Rotation invariant
– Scale invariant
– Affine (scale dependent on direction) – Affine invariant
valid for: orthographic camera, locally planar • Descriptors
object
– Rotation invariant
• Photometry – Scale invariant
– Affine intensity change (I → a I + b) – Affine invariant
Contents
Rotation Invariant Detection • Harris Corner Detector
– Description
• Harris Corner Detector – Analysis
• Detectors
– Rotation invariant
– Scale invariant
– Affine invariant
• Descriptors
– Rotation invariant
– Scale invariant
– Affine invariant
8
Scale Invariant Detection Scale Invariant Detection
• Consider regions (e.g. circles) of different sizes • The problem: how do we choose corresponding
around a point circles independently in each image?
• Regions of corresponding sizes will look the same
in both images
f f f Good ! L = σ 2 ( Gxx ( x, y, σ ) + G yy ( x, y, σ ) )
bad bad (Laplacian)
region size region size region size
DoG = G ( x, y, kσ ) − G ( x, y, σ )
(Difference of Gaussians)
• For usual images: a good function would be a one
which responds to contrast (sharp local intensity where Gaussian
change) x2 + y2
− Note: both kernels are invariant to
G ( x, y , σ ) = 1
2πσ
e 2σ 2
scale and rotation
9
Scale Invariant Detection Scale Invariant Detectors
← Laplacian →
scale
• Compare to human vision: eye’s response • Harris-Laplacian1
Find local maximum of:
– Harris corner detector in
y
space (image coordinates)
– Laplacian in scale
← Harris → x
← DoG →
Find local maximum of:
– Difference of Gaussians in
space and scale y
← DoG → x
1 K.Mikolajczyk, C.Schmid. “Indexing Based on Scale Invariant Interest Points”. ICCV 2001
2 D.Lowe. “Distinctive Image Features from Scale-Invariant Keypoints”. Accepted to IJCV 2004
Shimon Ullman, Introduction to Computer and Human Vision Course, Fall 2003
Methods:
1. Harris-Laplacian [Mikolajczyk, Schmid]: maximize Laplacian over
scale, Harris’ measure of corner response over the image
2. SIFT [Lowe]: maximize Difference of Gaussians over scale and space
K.Mikolajczyk, C.Schmid. “Indexing Based on Scale Invariant Interest Points”. ICCV 2001
10
Affine Invariant Detection Affine Invariant Detection
• Take a local intensity extremum as initial point • The regions found may not exactly correspond, so we
• Go along every ray starting from this point and stop when approximate them with ellipses
extremum of function f is reached • Geometric Moments:
f I (t ) − I 0
f (t ) =
m pq = ∫x Fact: moments mpq uniquely
p
t
y q f ( x, y )dxdy
points along the ray
1
t ∫ I (t ) − I
o
0 dt
2 determine the function f
• We will obtain approximately
Taking f to be the characteristic function of a region
corresponding regions (1 inside, 0 outside), moments of orders up to 2 allow
to approximate the region by an ellipse
Remark: we search for scale
in every direction
This ellipse will have the same moments of
orders up to 2 as the original region
T.Tuytelaars, L.V.Gool. “Wide Baseline Stereo Matching Based on Local,
Affinely Invariant Regions”. BMVC 2000.
J.Matas et.al. “Distinguished Regions for Wide-baseline Stereo”. Research Report of CMP, 2001.
11
Contents Point Descriptors
• Harris Corner Detector • We know how to detect points
– Description • Next question:
– Analysis How to match them?
• Detectors
– Rotation invariant
– Scale invariant
– Affine invariant
?
• Descriptors
– Rotation invariant
– Scale invariant
Point descriptor should be:
– Affine invariant
1. Invariant
2. Distinctive
12
Contents Descriptors Invariant to Scale
• Harris Corner Detector • Use the scale determined by detector to
– Description compute descriptor in a normalized frame
– Analysis
• Detectors For example:
– Rotation invariant • moments integrated over an adapted window
– Scale invariant • derivatives adapted to scale: sIx
– Affine invariant
• Descriptors
– Rotation invariant
– Scale invariant
– Affine invariant
F.Mindru et.al. “Recognizing Color Patterns Irrespective of Viewpoint and Illumination”. CVPR99
Scale = 2.5
Σ1−1 = A1T A1 A1 A2 Σ 2−1 = A2T A2 Rotation = 450
rotation
13
CVPR 2003 Tutorial Invariant Local Features
• Image content is transformed into local feature
Recognition and Matching coordinates that are invariant to translation, rotation,
scale, and other imaging parameters
Based on Local Invariant
Features
David Lowe
Computer Science Department
University of British Columbia
SIFT Features
r
lu
B
trac
b
u
S
r
lu
B
trac
b
u
S
14
Select canonical orientation Example of keypoint detection
Threshold on value at DOG peak and on ratio of principle
curvatures (Harris approach)
15
Talk Resume
A good SIFT features tutorial • Stable (repeatable) feature points can be detected
regardless of image changes
– Scale: search for correct scale as maximum of
http://www.cs.toronto.edu/~jepson/csc2503/tutSIFT04.pdf appropriate function
By Estrada, Jepson, and Fleet. – Affine: approximate regions with ellipses (this
operation is affine invariant)
• Invariant and distinctive descriptors can be
computed
– Invariant moments
– Normalizing with respect to scale and affine
transformation
16
Quantitative evaluation of detectors Comparison of different detectors
repeatability - image rotation
• Repeatability rate : percentage of corresponding points
homography
[Comparing and Evaluating Interest Points, Schmid, Mohr & Bauckhage, ICCV 98]
17
Evaluation of affine invariant detectors Quantitative evaluation of descriptors
repeatability – perspective transformation • Evaluation of different local features
0 – SIFT, steerable filters, differential invariants, moment invariants,
cross-correlation
• Measure : distinctiveness
40 – receiver operating characteristics of
detection rate with respect to false positives
Experimental
Scale change (factor 2.5)
evaluation
Harris-Laplace DoG
18
SIFT – Scale Invariant Feature Transform
end • Descriptor overview:
– Determine scale (by maximizing DoG in scale and in space),
local orientation as the dominant gradient direction.
Use this scale and orientation to make all further computations
invariant to scale and rotation.
– Compute gradient orientation histograms of several small windows
(128 values for each point)
– Normalize the descriptor to make it invariant to intensity change
D.Lowe. “Distinctive Image Features from Scale-Invariant Keypoints”. Accepted to IJCV 2004
19