Lecture 4 Harris
Lecture 4 Harris
Lecture-4
Contents
Harris Corner Detector
Sum of Squares Differences (SSD)
Corrleation
Taylor Series
Eigen Vectors and Eigen Values
Invariance and co-variance
What is an interest point
Expressive texture
The point at which the direction of the
boundary of object changes abruptly
Intersection point between two or more
edge segments
What is an interest point
Expressive texture
The point at which the direction of the
boundary of object changes abruptly
Intersection point between two or more
edge segments
Synthetic & Real
Interest Points
deformed
Slide Credit: James Hays
Overview of Keypoint Matching
1. Find a set of
distinctive key-
points
A1
2. Define a region
around each
A2 A3 keypoint
3. Extract and
normalize the
region content
fA fB
4. Compute a local
descriptor from the
normalized region
d ( f A, fB ) T
5. Match local
descriptors
K. Grauman, B. Leibe
Goals for Keypoints
A2 A3
Description of patches
Features Descriptors
Choosing interest points
Kristen Grauman
Goal: interest operator repeatability
• We want to detect (at least some of) the
same points in both images.
?
• Must provide some invariance to geometric
and photometric differences between the two
views.
Kristen Grauman
Some patches can be localized
or matched with higher accuracy than
others.
Some patches can be localized
or matched with higher accuracy than
others.
Harris Interest Point Detector
Cited by 8636
Harris Corner Detector
Corner point can be recognized in a window
Shifting a window in any direction should give
a large change in intensity
f Image
h Kernel
f
h
f1 f2 f3 h1 h2 h3 f * h f1h1 f 2 h2 f 3 h3
f4 f5 f6 h4 h5 h6 f 4 h4 f 5 h5 f 6 h6
f7 f8 f9 h7 h8 h9 f 7 h7 f 8 h8 f 9 h9
Correlation
f h f k , l h k , l Cross correlation
k l
f f f k , l f k , l Auto correlation
k l
Correlation Vs SSD
SSD f k , l h k , l
2
Sum of Squares Difference
minimize k l
SSD f k , l 2h k , l f k , l h k , l
2 2
k l
SSD 2h k , l f k , l
minimize These terms do not depend
on correlation
k l
SSD 2h k , l f k , l
maximize k l
Correlation h k , l f k , l
maximize k l
f f f k , l f k , l
k l
Mathematics of Harris
Detector
Change of intensity for the shift (u,v)
E (u, v ) w( x, y ) [ I ( x u, y v ) I ( x, y )] 2
x, y
window function shifted intensity intensity
Auto-correlation
Auto-Correlation
Brook Taylor (1685-1731)
His marriage in 1721 with Miss Brydges of
Wallington, Surrey, led to an estrangement
from his father, which ended in 1723 after
her death in giving birth to a son, who also
died.
1725 he married—this time with his
father's approval—Sabetta Sawbridge of
Olantigh, Kent, who also died in childbirth
in 1730 ; in this case, however, his
daughter, Elizabeth, survived.
( x a) 2 ( x a)3
f ( x) f (a) ( x a) f x f xx f xxx
2! 3!
Taylor Series
Express I ( x u, y v ) at ( x, y ) :
I ( x u , y v ) I ( x, y ) I x ( x u x ) I y ( y v y )
I ( x u , y v ) I ( x, y ) I x u I y v
Taylor Series
f ( x, y , t ) f ( x dx , y dy , t dt )
E (u, v ) [uI x vI ] y
2
x, y
2
I x
E (u, v ) u v IxIx IxIy
M
I y I y
x, y
I y
Ix u x, y I x I y
E (u, v ) u v I x I y
x, y Iy v
Ix u
E (u, v ) u v I x I y u
x , y I y v E( u ,v ) u v M
v
Mathematics of Harris
Detector
u IxIx IxIy
E( u ,v ) u v M M
v x, y I x I y I y I y
E(u,v) is an equation of an ellipse.
(2)
(1)
Eigen Vectors and Eigen Values
The eigen vector, x, of a matrix A is a special vector, with
the following property
Eigen Values
Eigen Vectors
Eigen Values
Eigen Vectors
MATLAB Fuction
[vectorC,valueC]=eig(C);
Mathematics of Harris
Detector
Classification of 2 “Edge”
image points using 2 >> 1 “Corner”
eigenvalues of M: 1 and 2 are large,
1 ~ 2;
E increases in all
directions
1 1 0
M SDS D
0 2
If pixel value is
greater than
its neighbors
then it is a local
maxima.
Other Version of Harris
Detectors
R 1 2 Triggs
det( D ) 12
R Szeliski (Harmonic mean)
trace( D ) 1 2
R 1 Shi-Tomasi
2
1
Mathematics of Harris
Detector
Change of intensity for the shift (u,v)
E (u, v ) w( x, y ) [ I ( x u, y v ) I ( x, y )] 2
x, y
window function shifted intensity intensity
Auto-correlation
Window functions
UNIFORM GAUSSIAN
Mathematics of Harris
Detector
Change of intensity for the shift (u,v)
E (u, v ) w( x, y ) [ I ( x u, y v ) I ( x, y )] 2
x, y
window function shifted intensity intensity
Auto-correlation
Window functions
UNIFORM GAUSSIAN
Mathematics of Harris
Detector
E (u, v ) w(x, y) [ I ( x u, y v ) I ( x, y )]2
x, y
window function
w
x
,
y
shifted intensity intensity
E ( u, v ) ︵
︶ [ I ( x, y ) uI x vI y I ( x, y )]2
Taylor Series
w
i
n
d
o
w
f
u
n
c
t
i
o
n
x, y intensity
shifted intensity
w
x
,
y
E ( u, v ) ︵ ︶[uI x vI y ]2
2
w
x
,
y
x, y
I
E ( u, v ) ︵ ︶ u v x
I
y IxIx IxIy
M
x, y
I y I y
w
x
,
y
u
︶ x I x I y
I
E (u, v ) u v ︵ u
x , y
I
y v E( u ,v ) u v M
v
Corner Detection: Mathematics
Change in appearance of window w(x,y)
for the shift [u,v]:
E (u, v) w( x, y ) I ( x u , y v) I ( x, y )
2
x, y
I(x, y)
E(u, v)
E(3,2)
w(x, y)
Slide Credit: James Hays
Corner Detection: Mathematics
Change in appearance of window w(x,y)
for the shift [u,v]:
E (u, v) w( x, y ) I ( x u , y v) I ( x, y )
2
x, y
I(x, y)
E(u, v)
E(0,0)
w(x, y)
Slide Credit: James Hays
Corner Detection: Mathematics
Change in appearance of window w(x,y)
for the shift [u,v]:
E (u, v) w( x, y ) I ( x u , y v) I ( x, y )
2
x, y
Source: R. Szeliski
Corner Detection: Mathematics
Change in appearance of window w(x,y)
for the shift [u,v]:
E (u, v) w( x, y ) I ( x u , y v) I ( x, y )
2
x, y
u
E (u , v) [u v] M
v
I x2 IxI y
M w( x, y ) 2
x, y I x I y I y
M
Slide Credit: James Hays
Corners as distinctive interest points
I x I x IxI y
M w( x, y )
I
y x I IyIy
2 x 2 matrix of image derivatives (averaged in
neighborhood of a point).
I I I I
Notation: Ix Iy IxI y
x y x y
Slide Credit: James Hays
Interpreting the second moment matrix
The surface E(u,v) is locally approximated by a
quadratic form. Let’s try to understand its shape.
u
E (u , v) [u v] M
v
I x2 IxI y
M w( x, y ) 2
x, y I x I y I y
I x2 I x I y 1 0
M w( x, y ) 2
x, y I x I y I y 0 2
(max)-1/2
(min)-1/2
Visualization of second moment matrices
5. Non-maxima suppression 70
har
Slide Credit: James Hays
Invariance and covariance
• We want corner locations to be invariant to photometric
transformations and covariant to geometric transformations
• Invariance: image is transformed and corner locations do not change
• Covariance: if we have two transformed versions of the same image,
features should be detected in corresponding locations
IaI+b
R R
threshold
Corner