Harris Corner Detector
Harris Corner Detector is a corner detection operator that is commonly used in computer vision algorithms to extract corners and infer features of an image. It was first introduced by Chris Harris and Mike Stephens in 1988 upon the improvement of Moravec's corner detector.[1] Compared to the previous one, Harris' corner detector takes the differential of the corner score into account with reference to direction directly, instead of using shifting patches for every 45 degree angles, and has been proved to be more accurate in distinguishing between edges and corners.[2] Since then, it has been improved and adopted in many algorithms to preprocess images for subsequent applications.
Introduction
A corner is a point whose local neighborhood stands in two dominant and different edge directions. In other words, a corner can be interpreted as the junction of two edges, where an edge is a sudden change in image brightness.[3] Corners are the important features in the image, and they are generally termed as interest points which are invariant to translation, rotation and illumination. Although corners are only a small percentage of the image, they contain the most important features in restoring image information, and they can be used to minimize the amount of processed data for motion tracking, image stitching, building 2D mosaics, stereo vision, image representation and other related computer vision areas.
In order to capture the corners from the image, researchers have proposed many different corner detectors including the Kanade-Lucas-Tomasi (KLT) operator and the Harris operator which are most simple, efficient and reliable for use in corner detection. These two popular methodologies are both closely associated with and based on the local structure matrix. Compared to the Kanade-Lucas-Tomasi corner detector, the Harris corner detector provides good repeatability under changing illumination and rotation, and therefore, it is more often used in stereo matching and image database retrieval. Although there still exists drawbacks and limitations, the Harris corner detector is still an important and fundamental technique for many computer vision applications.
Development of Harris Corner Detection Algorithm [1]
Without loss of generality, we will assume a grayscale 2-dimensional image is used. Let this image be given by [math]\displaystyle{ I }[/math]. Consider taking an image patch [math]\displaystyle{ (x, y) \in W }[/math](window) and shifting it by [math]\displaystyle{ (\Delta x,\Delta y) }[/math]. The sum of squared differences (SSD) between these two patches, denoted [math]\displaystyle{ f }[/math], is given by:
- [math]\displaystyle{ f(\Delta x,\Delta y) = \underset{(x_k,y_k)\in W}\sum\left(I(x_k,y_k) - I(x_k+\Delta x,y_k+\Delta y)\right)^2 }[/math]
[math]\displaystyle{ I(x+\Delta x,y+\Delta y) }[/math] can be approximated by a Taylor expansion. Let [math]\displaystyle{ I_x }[/math] and [math]\displaystyle{ I_y }[/math] be the partial derivatives of [math]\displaystyle{ I }[/math], such that
- [math]\displaystyle{ I(x+\Delta x,y+\Delta y) \approx I(x,y) + I_x(x,y)\Delta x+I_y(x,y)\Delta y }[/math]
This produces the approximation
- [math]\displaystyle{ f(\Delta x,\Delta y) \approx \underset{(x,y)\in W}\sum \left( I_x(x,y)\Delta x + I_y(x,y)\Delta y \right)^2, }[/math]
which can be written in matrix form:
- [math]\displaystyle{ f(\Delta x,\Delta y) \approx \begin{pmatrix} \Delta x & \Delta y \end{pmatrix} M \begin{pmatrix} \Delta x \\ \Delta y \end{pmatrix}, }[/math]
where M is the structure tensor,
- [math]\displaystyle{ M = \underset{(x,y)\in W}\sum \begin{bmatrix} I_x^2 & I_x I_y \\ I_x I_y & I_y^2 \end{bmatrix} = \begin{bmatrix} \underset{(x,y)\in W}\sum I_x^2 &\underset{(x,y)\in W} \sum I_x I_y \\ \underset{(x,y)\in W}\sum I_x I_y & \underset{(x,y)\in W}\sum I_y^2 \end{bmatrix} }[/math]
Process of Harris Corner Detection Algorithm[4][5][6]
Commonly, Harris corner detector algorithm can be divided into five steps.
- Color to grayscale
- Spatial derivative calculation
- Structure tensor setup
- Harris response calculation
- Non-maximum suppression
Color to grayscale
If we use Harris corner detector in a color image, the first step is to convert it into a grayscale image, which will enhance the processing speed.
The value of the gray scale pixel can be computed as a weighted sums of the values R, B and G of the color image,
- [math]\displaystyle{ \sum_{C\,\in\,\{R,G,B\}} w_C \cdot C }[/math],
where, e.g.,
- [math]\displaystyle{ w_R=0.299,\ w_G=0.587,\ w_B=1-(w_R+w_G)=0.114. }[/math]
Spatial derivative calculation
Next, we are going to compute [math]\displaystyle{ I_x( x, y) }[/math] and [math]\displaystyle{ I_y( x, y) }[/math].
Structure tensor setup
With [math]\displaystyle{ I_x( x, y) }[/math] , [math]\displaystyle{ I_y( x, y) }[/math], we can construct the structure tensor [math]\displaystyle{ M }[/math].
Harris response calculation
For [math]\displaystyle{ x\ll y }[/math], one has [math]\displaystyle{ \tfrac{x\cdot y}{x+y}=x\tfrac{1}{1+x/y}\approx x. }[/math] In this step, we compute the smallest eigenvalue of the structure tensor using that approximation:
[math]\displaystyle{ \lambda _{min} \approx \frac{ \lambda _1 \lambda _2} {(\lambda _1+\lambda _2)} = \frac{\det(M)} {\mathrm{tr}(M)} }[/math]
with the trace [math]\displaystyle{ \mathrm{tr}(M) = m_{11} + m_{22} }[/math].
Another commonly used Harris response calculation is shown as below,
[math]\displaystyle{ R = \lambda _1 \lambda _2 - k\cdot(\lambda _1 + \lambda _2)^2 = \det(M) - k\cdot\mathrm{tr}(M)^2 }[/math]
where [math]\displaystyle{ k }[/math] is an empirically determined constant; [math]\displaystyle{ k \in [0.04, 0.06] }[/math] .
Non-maximum suppression
In order to pick up the optimal values to indicate corners, we find the local maxima as corners within the window which is a 3 by 3 filter.
Improvement[7][8]
- Harris-Laplace Corner Detector[9]
- Differential Morphological Decomposition Based Corner Detector[10]
- Multi-scale Bilateral Structure Tensor Based Corner Detector[11]
Applications
- Image Alignment, Stitching and Registration[12]
- 2D Mosaics Creation[13]
- 3D Scene Modeling and Reconstruction[14]
- Motion Detection[15]
- Object Recognition[16]
- Image Indexing and Content-based Retrieval[17]
- Video Tracking[18]
See also
- Structure tensor
- Harris affine region detector
- Corner detection
- Feature detection (computer vision)
- Computer vision
- List of computer vision topics
References
- ↑ 1.0 1.1 Chris Harris and Mike Stephens (1988). "A Combined Corner and Edge Detector". 15.
- ↑ "A Comparative Study between Moravec and Harris Corner Detection of Noisy Images Using Adaptive Wavelet Thresholding Technique". 2012. arXiv:1209.1558 [cs.CV].
- ↑ Konstantinos G. Derpanis (2004). "The harris corner detector.". York University.
- ↑ "Harris Operator Corner Detection using Sliding Window Method - Google Scholar". https://scholar.google.com/scholar?q=++Harris+Operator+Corner+Detection+using+Sliding+Window+Method&btnG=&hl=en&as_sdt=0%252C36.
- ↑ "The Comparison and Application of Corner Detection Algorithms - Google Scholar". https://scholar.google.com/scholar?hl=en&q=The+Comparison+and+Application+of+Corner+Detection+Algorithms&btnG=&as_sdt=1%252C36&as_sdtp=.
- ↑ Javier Sánchez, Nelson Monzón and Agustín Salgado (2018). "An Analysis and Implementation of the Harris Corner Detector". Image Processing on Line 8: 305–328. doi:10.5201/ipol.2018.229.
- ↑ Bellavia, F.; Tegolo, D.; Valenti, C. (2011-03-01). "Improving Harris corner selection strategy". IET Computer Vision 5 (2): 87. doi:10.1049/iet-cvi.2009.0127.
- ↑ Rosten, Edward; Drummond, Tom (2006-05-07). Leonardis, Aleš. ed (in en). Machine Learning for High-Speed Corner Detection. Lecture Notes in Computer Science. Springer Berlin Heidelberg. pp. 430–443. doi:10.1007/11744023_34. ISBN 978-3-540-33832-1.
- ↑ "A Comparison of Affine Region Detectors - Google Scholar". https://scholar.google.com/scholar?q=+A+Comparison+of+Affine+Region+Detectors&btnG=&hl=en&as_sdt=0%252C36.
- ↑ Gueguen, L.; Pesaresi, M. (2011). "Multi scale Harris corner detector based on Differential Morphological Decomposition". Pattern Recognition Letters 32 (14): 1714–1719. doi:10.1016/j.patrec.2011.07.021. https://www.researchgate.net/publication/220644165.
- ↑ "A Multi-scale Bilateral Structure Tensor Based Corner Detector - Google Scholar". https://scholar.google.com/scholar?q=A+Multi-scale+Bilateral+Structure+Tensor+Based+Corner+Detector&btnG=&hl=en&as_sdt=0%252C36.
- ↑ Kang, Juan; Xiao, Chuangbai; Deng, M.; Yu, Jing; Liu, Haifeng (2011-08-01). Image registration based on harris corner and mutual information. 7. 3434–3437. doi:10.1109/EMEIT.2011.6023066. ISBN 978-1-61284-087-1.
- ↑ "Underwater Mosaic Creation using Video sequences from Different Altitudes - Google Scholar". https://scholar.google.com/scholar?hl=en&q=Underwater+Mosaic+Creation+using+Video+sequences+from+Different+Altitudes&btnG=&as_sdt=1%252C23&as_sdtp=.
- ↑ "Automated reconstruction of 3D scenes from sequences of images - Google Scholar". https://scholar.google.com/scholar?q=Automated+reconstruction+of+3D+scenes+from+sequences+of+images&btnG=&hl=en&as_sdt=0%252C23.
- ↑ Liu, Meng; Wu, Chengdong; Zhang, Yunzhou (2008-07-01). Multi-resolution optical flow tracking algorithm based on multi-scale Harris corner points feature. 5287–5291. doi:10.1109/CCDC.2008.4598340. ISBN 978-1-4244-1733-9.
- ↑ "Object Recognition from Local Scale-Invariant Features - Google Scholar". https://scholar.google.com/scholar?q=Object+Recognition+from+Local+Scale-Invariant+Features&btnG=&hl=en&as_sdt=0%252C36.
- ↑ "Salient Points for Content Based Retrieval - Google Scholar". https://scholar.google.com/scholar?q=Salient+Points+for+Content+Based+Retrieval+&btnG=&hl=en&as_sdt=0%252C23.
- ↑ "Tracking and Recognition of Objects using SURF Descriptor and Harris Corner Detection - Google Scholar". https://scholar.google.com/scholar?q=+Tracking+and+Recognition+of+Objects+using+SURF+Descriptor+and+Harris+Corner+Detection&btnG=&hl=en&as_sdt=0%252C23.
External links
- "Learn OpenCV by Examples : Harris Corner Detection"
- "Harris Corner Detection - OpenCV Documentation"
- "Harris Corner Detection - OpenCV-Python Tutorials"
- Online Implementation of the Harris Corner Detector - IPOL