CS 143 / Project 2 / Local Feature Matching

The final result of local feature matching. There are 79 good matches to 21 bad matches, with a percentage correct of a 79%

This project, local feature matching, revolves around detecting interest points, getting a discription of those interest points, and then matching the interest points from one image to other images. I have decided to cap the interest points that are returned as matches to 100.

Getting Interest Points

Corners makes great interest points. The algorithm that was implemented for this assignment uses the Harris corner detection algorithm. The basic idea of the algorithm is that as you move a window over a certain area, if that area is a corner, then the gradrient shift would be high wherever you move. If the area is an edge, then you would get a high response moving perpendicular to the edge and low response moving along with the edge. Once you get all the interest points, you want to use non maximum suppression to cut off some weaker interest points, since you do not want to return every corner. For this assignment, I used the build in matlab function Colfilt. I also have a hard threshold of .0000001 to remove the weaker interest points some more.

Getting the Feature Description for the Interest Points

The next step is to build a description for each interest points. This is done by building a histogram of gradient of each 16x16 window around an interest point. To build the histogram, I subdivide the 16x16 box into 4x4 box and bin their gradient angle into 8 different bins, giving me a 128 dimension descriptor for each interest points. Then you need to normalize the histogram so that the interest points can be consistent acroos multiple images, or as close to consistent as possible.

Matching the Features Description across multiple images

The last step is to match the interest points from one image to other images. In this project we are only working on two images. We use the ratio test to see if a particular interest point in one image should match to another interest point on another images. We use the histogram returned from part two to make this decision. Essentially, the ratio test involves getting all the Euclidean distance between the interest points in one image with the interest points of the other image. From there, you get the 2 points that are closet to you and find the ratio. If the ratio is less then a certain distance (for this assignment I used .87), then you return the interest point and the closest interest point on the other image as a match, with some degree of confidence.

Parameters in this Assignment

There are a few parameters to play with in this assignment.
  1. The alpha value for part 1
  2. An additional threshold of what interest points to keep in part 1
  3. Whether to clamp the histogram at 0.2 or not in part 2
  4. What the ratio cut off should be in part 3

Some results with different values for different parameters

I played around with changing some parameters and returning every interest points that I find, rather than capping the matches to just 100 matched interest points.

This is the base case with. There are 94 good matches and 29 bad matches.

If you change the alpha to .6 from .4, holding everything else constant, you get 78 good matches to 34 bad matches.

If you change the threshold to 0 rather than 0.0000001, holding everything else constant, you get 144 good matches to 40 bad matches. A lot more points are being returned with a better match but you also get some interest points that should not be interest points in the first place, such as a spot on the ground.

Clamping the value at 0.2 then renormalize, rather than not clamping the histogram gives you 61 good matches to 23 bad matches.

Raising the ratio to .95 from .87 will give you more interest points. It will give you 142 good matches to 205 bad matches. Since the number is so close to 1, you are not really filtering out any bad matches.

Lowering the ratio to .75 from .87 will give you less interest points. It will give you 35 good matches to 3 bad matches. The lower the ratio, the higher the confidence that it is the correct matching, but you are also filtering out some correct interest points that might not match at such a strict threshold.

It was interesting to play around with different parameters to see how they would affect the matching. As you can see, tweaking some parameter will give you more interesting points, some will raise your accuracy, some will lower it. However, there are always tradeoff. For example, lowing the ratio threshold will give you a higher percentage of accuracy, but you are matching fewwer interest points. Thus, you can decide what you might want depending on the situation and see what is acceptable and what is not.

Other Matching

Capricho Gaudi

Episcopal Gaudi

House

Statue of Liberty