Professional Documents
Culture Documents
Pi19404
February 23, 2013
Contents
Contents
Feature Detection - Harris Corner Detector 3
0.1 Introduction . . . . . . . . . 0.2 Feature Detection . . . . 0.3 Morvec Corner Detector 0.4 Corner Filtering . . . . . . 0.5 Implementation . . . . . . . . 0.6 Code . . . . . . . . . . . . . . References . . . . . . . . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
3 3 3 7 7 8 9
2 | 9
3 | 9
Feature Detection - Harris Corner Detector Now the window is shifted by small ammount and average change in intensity are analysed by shifting the window by small ammount in different directions. If the windowed patch has approximately constant intensity then all shifts will result in small change in average intensity. If the window consists of edge then shifts along the edge will produce small change while shifts perpendicular to edge will produce a large change, If the windowed patch consits of a corner or isolated point then all shifts will result in large change.
E (x; y ) =
jI (x + u; y + v) I (u; v)j
(1)
x,y is the shift in x and y direction and u,v is pixels within the window. The set of sifts analysed are (0; 1); (1; 1); (0; 1); (1; 1). Thus expression computes the sum of derivatives in horizontal and vertical directions of a small patch centered at (u; v ). If the minimum value of E (x; y ) is above a threshold we mark the pixel (u; v ) are desired corner. This implies that if the magnitude of derivative along vertical and horizontal direction are above a certain threshold it is marked as desired corner. Such a point corresponds to isolated pixel or corner.
4 | 9
@I @x
+ y @y
@I
P( P( P(
u;v )
jx
@I @x
+ y @y
@I
u;v )
jxX + yY j
X 2 + y2
u;v )
x2 X 2 + y 2 Y 2 + 2xyXY
E (x; y ) = x2
P(
u;v )
P(
u;v )
Y 2 + 2xy
P(
u;v )
XY
(2)
A C C B
!
x y
x x y M where M is 2 x 2 matrix y
Let us analyze the eigen values of the matrix which again are indicative of the strength of derivative and edge orientation along the x and y direction. If the window has constant intensity the eigen values will be small as derivatives will be small. If one eigen value is large while other is small it indicates a edge and indicates windows contains a linear edge. If both eigen values are large then it indicates a corner or isolated point . Thus we have to classify the point as corner based on the above criteria.
5 | 9
E=
(A
) (B ) (C )
=0
T r (M )2 4
p p
(3)
det(M )
0:25
T r(M ) det(M )
2
0:25
T r(M ) det(M )
2
det(M ) will be small if any one of eigen values is small det(M ) will be large if both eigen values are large. T r(M ) will be large only if one/both of eigen values are large
In the original paper they construct a measure to test if eigen values are large called response function
R = Det(M ) kT r(M )2
(4)
Amplitue of response function is plotted for various values of eigen values and different type of region flat,edge,corners were analysed and emprical values of k was determined to be 0.04. Also if image contrast changes due to illumination etc the reponse function amplitude increases.Thus we need to define what we mean by small amplitude of response function. R is positive in the corner regions ,negative in the edge regions and small in the flat regions.
6 | 9
Feature Detection - Harris Corner Detector Thus the first task of feature detector is to detector points for which response function gives large values.
0.5 Implementation
The factor used for response function thresholding is called quality level and is choosen to be 1/100 of maximum value by defaul. The block size is window size of the path which is used for computation of the elements of matrix M. The minDistance is the minimum distance between adjancent corner pixels and the cell size over which local maximum is choosen.
7 | 9
0.6 Code
we define a main feature_detector base class containing methods and data common to all feature detector. the harris_corner class is derived class containing specific implementations of algorithms. The code OpenCV code can be found in code repository https://github.com/pi19404/m19404/tree/master/FEATURE_DETECTOR or https://code.google.com/p/m19404/source/browse/FEATURE_DETECTOR/
8 | 9
Bibliography
Bibliography
[1] Chris Harris and Mike Stephens. A combined corner and edge detector. In: In
Proc. of Fourth Alvey Vision Conference.
[2]
Jianbo Shi and C. Tomasi. Good features to track. In: Computer Vision and
Pattern Recognition, 1994. Proceedings CVPR '94., 1994 IEEE Computer Society Conference on.
doi: 10.1109/CVPR.1994.323794.
9 | 9