CS 143 / Project 2 / Local Feature Matching

Overview

The goal of this assignment was to create a local feature matching algorithm by detecting interest points in two physically different yet similar scences, extracting features and eventually matching them against each other.

For this project I implemented the following algorithms:

Finding interest points

In order to find suitable interest points for matching, I implemented a Harris Corner Detection. My implementation works as follows:

In a next step, I supress local non-maxima by simply nulling all non-maximas within regions of the size of 3x3. This approach, however, causes most of the interest points to be found in high contrast regions leads to an unevenly distributed set of interest points. This is why I use Adaptive Non-Maximum Surpression (ANMS).

Interest Points found by using Harris corner detection on two different images.

Describing features

Each interest point is then passed on the a function that tries to describe it by subdiving its surrounding area into 4x4 subareas and computing a histogram of all of their gradients.

According to the angle of the gradient in each subregion, the magnitude of the gradient is added to one of 8 bins. These bins can later be used to identify identical features.

Feature Matching

In a last step, the descriptor of both images are compared by using a nearest neighbor approach. More precisely, the ratio of the two nearest neighbors is observed in order to determine whether two features match using this forumla:

For the images I used, I found this approach to work best when features are accepted as match only if the ratio of the closest distance to the second closest is less than 0.7 - 0.9.

28 good matches and only 4 bad matches.

Results

The results vary on the chosen parameters and on the set of images being used. Namely the following parameters can have great effects on the outcome:

Also, since this implemenation is not scale and rotation invariant, images at different scales or taken from very different position won't lead to many matching features. As a consequence when comparing non-similar images, interest points should be analyzed at different scales and the gradient of the of a feature should be computed relatively to the features domninant orientation.