18 Feature Detectors PDF
18 Feature Detectors PDF
Building a Panorama
Step 1: Detect feature points in both images Step 1: Detect feature points in both images
Step 2: Find corresponding pairs Step 2: Find corresponding pairs
Step 3: Use these pairs to align images
1
Matching with Features Matching with Features
Problem 1: Problem 2:
Detect the same point independently in both images For each point correctly recognize the corresponding
one
?
no chance to match!
2
The Basic Idea
E (u, v) = w( x, y ) [ I ( x + u, y + v) I ( x, y ) ]
2
x, y
x, y
Window Shifted
function intensity
Intensity Second-order Taylor expansion of E(u,v) about (0,0)
(bilinear approximation for small shifts):
E (0,0) 1 Euu (0,0) Euv (0,0) u
Window function w(x,y) = or E (u , v) E (0,0) + [u v] u + [u v ] E (0,0) E (0,0) v
Ev (0,0) 2 uv vv
1 in window, 0 outside Gaussian
3
Harris Detector: Mathematics Interpreting the second moment
Expanding E(u,v) in a 2nd
order Taylor series expansion, we matrix
have,for small shifts [u,v], a bilinear approximation:
First, consider an axis-aligned corner:
u
E (u , v ) [ u , v ] M
v
where M is a 22 matrix computed from image derivatives:
I2 IxI y
M = w( x, y ) x
x, y I x I y I y2
u (max)-1/2
If either is close to 0, then this is not a corner, [u v ] M = const (min)-1/2
so look for locations where both are large. v
4
Harris Detector: Mathematics Harris Detector: Summary
R = det(M ) k trace(M ) 2 = 12 k (1 + 2 ) 2 , 0.04 k .06
Average intensity change in direction [u,v] can be expressed
2 as a bilinear form:
Edge Corner
u
R<0 E (u , v ) [ u , v ] M
R depends only on v
eigenvalues of M Describe a point in terms of eigenvalues of M:
R>0
measure of corner response
R is large for a corner
R = 12 k ( 1 + 2 )
2
Algorithm:
1. Compute Gaussian derivatives at each pixel
2. Compute second moment matrix M in a
Gaussian window around each pixel
3. Compute corner response function R
4. Threshold R
5. Find local maxima of response function
(nonmaximum suppression)
5
Harris Detector: Workflow Harris Detector: Workflow
Take only the points of local maxima of R
9 Intensity scale: I a I
R R
threshold
6
Harris Detector: Some Properties Harris Detector: Some Properties
Invariance
We want features to be detected despite
geometric or photometric changes in the image:
if we have two transformed versions of the
We want to: same image, features should be detected in
corresponding locations
detect the same interest points
regardless of image changes
7
Models of Image Change Contents
Geometric Harris Corner Detector
Rotation Description
Analysis
Detectors
Scale Rotation invariant
Scale invariant
Affine invariant
Affine
Descriptors
valid for: orthographic camera, locally planar
Rotation invariant
object
Scale invariant
Affine invariant
Photometric
Affine intensity change (I a I + b)
Consider regions (e.g. circles) of different sizes around The problem: how do we choose corresponding circles
a point independently in each image?
Regions of corresponding sizes will look the same in
both images
8
Scale Invariant Detection Scale Invariant Detection
Solution: Common approach:
Design a function on the region (circle), which is scale
invariant (the same for corresponding regions, even if
they are at different scales) Take a local maximum of this function
For a point in one image, we can consider it as a Important: this scale invariant region size is
function of region size (circle radius) found in each image independently!
A good function for scale detection: Functions for determining scale f = Kernel Image
has one stable sharp peak
Kernels:
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 + y 2
Note: both kernels are invariant to
G ( x, y , ) = 1
2
e 2 2
scale and rotation
scale
Harris-Laplacian1 Experimental evaluation of detectors
Find local maximum of: w.r.t. scale change
Harris corner detector in
y
space (image coordinates)
Laplacian in scale
Harris x Repeatability rate:
# correspondences
SIFT (Lowe)2 scale # possible correspondences
DoG
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 K.Mikolajczyk, C.Schmid. Indexing Based on Scale Invariant Interest Points. ICCV 2001
9
Scale Invariant Detection: Contents
Summary Harris Corner Detector
Description
Given: two images of the same scene with a large scale Analysis
difference between them
Detectors
Goal: find the same interest points independently in
each image Rotation invariant
Solution: search for maxima of suitable functions in Scale invariant
scale and in space (over the image) Affine invariant
Descriptors
Rotation invariant
Methods:
Scale invariant
1. Harris-Laplacian [Mikolajczyk, Schmid]: maximize Laplacian over
scale, Harris measure of corner response over the image Affine invariant
2. SIFT [Lowe]: maximize Difference of Gaussians over scale and space
f I (t ) I 0
f (t ) = t
Now we go on to:
Affine transform (rotation + non-uniform scale) We will obtain approximately
corresponding regions
Algorithm summary (detection of affine invariant region): The regions found may not exactly correspond, so we approximate
Start from a local intensity extremum point them with ellipses
Go in every direction until the point of extremum of some
function f Geometric Moments:
Curve connecting the points is the region boundary
m pq = x Fact: moments mpq uniquely
p
y q f ( x, y )dxdy
Compute geometric moments of orders up to 2 for this region determine the function f
2
Replace the region with ellipse
Taking f to be the characteristic function of a region
(1 inside, 0 outside), moments of orders up to 2 allow
to approximate the region by an ellipse
10
Affine Invariant Detection Affine Invariant Detection :
Covariance matrix of region points defines an ellipse:
Summary
Under affine transformation, we do not know in advance shapes of
q = Ap the corresponding regions
Ellipse given by geometric covariance matrix of a region robustly
approximates this region
For corresponding regions ellipses also correspond.
pT 11 p = 1 qT 21q = 1
1 = pp T
2 = qqT
region 1
region 2
( p = [x, y]Tis relative Methods:
to the center of mass) 2 = A1 AT 1. Search for extremum along rays [Tuytelaars, Van Gool]:
2. Maximally Stable Extremal Regions [Matas et.al.]
Ellipses, computed for corresponding
regions, also correspond!
11
Descriptors Invariant to Rotation Descriptors Invariant to Rotation
Image moments in polar coordinates Find local orientation
F.Mindru et.al. Recognizing Color Patterns Irrespective of Viewpoint and Illumination. CVPR99
12
Affine Invariant Descriptors SIFT Scale Invariant Feature Transform1
Find affine normalized frame Empirically found2 to show very good performance, invariant to
image rotation, scale, intensity change, and to moderate affine
A transformations
1 = ppT 2 = qqT
Scale = 2.5
11 = A1T A1 A1 A2 21 = A2T A2 Rotation = 450
rotation
SIFT Features
ubtrac
S
13
Scale space processed one octave at Key point localization
a time Detect maxima and minima of
difference-of-Gaussian in scale space
Fit a quadratic to surrounding values
for sub-pixel and sub-scale
interpolation (Brown & Lowe, 2002)
Taylor expansion around point:
lur
B
ubtrac
S
0 2
14
Feature stability to affine change Distinctiveness of features
Match features after random change in image scale & Vary size of database of features, with 30 degree affine
orientation, with 2% image noise, and affine distortion change, 2% image noise
Find nearest neighbor in database of 30,000 features Measure % correct for single nearest neighbor match
15