Created and recorded by Yiming Cai, November 2021
Music by Armin Heller, see https://lmms.io/lsp/?action=show&file..., / twilight-area and https://creativecommons.org/licenses/...
Script
In the video for feature matching, I used a Matlab built-in function called Harris corner detection. Harris corner detection is an algorithm that can be used to detect features, find crossing points of edges. In this video, I will talk about the basic idea of Harris corner detection and presents functions that are built based on Harris corner detection.
Harris corner detection detects the change of grayscale inside a moving frame. By detecting the changes inside a square frame, through the window, it could sense the changes once there is a significant change of grayscale.
Let's begin with the idea of Harris corner detection. Harris corner detection creates a square frame to move within the image we want to detect features. Take this triangle as an example. If the detecting area is inside the triangle or outside, there is no changes appear in the square frame. So the result of the detection will be no feature detected.
How about placing the frame on the edge of the triangle? By moving the square frame along with the direction of the edge, you will also find out that, there are still no changes inside the frame. So in this situation, Harris corner detection still cannot detect any feature.
But, if the moving direction of the frame is different than the direction of the edge, like the example here, the Harris corner detector will locate the location of the edge.
The most important part is here, corner detection, which is also the name of the Harris algorithm. By moving the frame, when the frame detects the cross point of two edges, the algorithm will be able to detect the existence of the crossing point of edges, which is the corner.
This is the formula of Harris corner detection. It's very complex to actually calculate the result every time. So by reducing the time usage of calculation, there are two tricks for calculating. One is to expand the formula and express it in matrix form. After expanding, even it's easier for Matlab to process a matrix, still, we will want to reduce unnecessary calculations when applying the algorithm.
(switch to code)
So here is the second trick, reduce weak features. Apply the gaussian kernel, to reduce weak features of an image. Or, you can smaller the input image, rescale the image so it loses some unnecessary details when applying Harris corner detection.
(run example)
So in this video, we talked about the idea of Harris corner detection, and presents the example of Harris corner detection. Hope this video is helpful.