“Feature Detection And Matching”

Brennan Chu And Toshi Noguchi

CS 4670 – Intro to Computer Vision

Project 2 webpage

 

Feature Detection

computeHarrisValues: This methods goes through the image and computes the Harris corner value for every pixel. The source image was convolved with a SobelX kernel and a SobelY kernel to find the x and y derivatives. A 5x5 Gaussian mask was chosen for the weight. The corner cases where a 5x5 window was taken outside of the image was handled by  using the closest pixel value along the edge.

computeLocalMaxima: This method loops through the Harris Image and computes the local maxima in a 5x5 window. Edge cases were handled the same way where pixel values outside of the image were replaced with the closest pixel along the edge. Also, a boolean called exists was used to check if there was already a local maxima in the 5x5 window to handle areas where all the pixel values are the same. The threshold was chosen to be .1 because it seemed to be in a reasonable range.

The orientation angle of each feature was defined as the angle of the gradient. The original image was convolved with a 7x7 Gaussian and then the derivatives were calculated by convolving with a SobelX and SobelY kernel. We defined the angle using the gradient instead of the eigen vectors because it is computationally much simpler and provides equally reliable results.

Feature Description

ComputeSimpleDescriptor: This is a simple descriptor that uses a 5x5 window of pixels. Pixels that produced 5x5 windows out of bounds were simply omitted to limit the number of features. We want to have a select number of good features and omitting the ones on the very edge will not significantly hurt the performance of the descriptor.

ComputeMOPSDescriptors: This method implements our MOPS descriptor. The original image was first filtered with a 7x7 Gaussian for down sampling. Then for each features four transforms were performed. First the window was translated to the origin and then rotated by the feature angle. Then it was scaled and translated to the top left corner. WarpGlobal was used to apply these transformations into an 8x8 window. The mean and standard deviation were found to normalize all the values. 

 

Feature matching

ratioMatchFeatures: This method performs ratio feature matching where the distance is defined as the first best match with SSD over the second best match with SSD. The method was implemented by finding the two features with the two smallest distances using SSD and then finding their ratio.

Below is an image taken from the GUI when matching yosemite1.jpg to yosemite2.jpg:

 

 

 

ROC Plots

 

Description: C:\Users\labuser\Downloads\yosemite.pngDescription: C:\Users\labuser\Downloads\graf.png

                                       GRAF                                                                                        YOSEMITE

 

Graf:

simple + SSD: 0.540022

simple + ratio test: 0.503300

MOPS + SSD: 0.702843

MOPS + ratio test: 0.623140

 

Yosemite:

simple + SSD: 0.852079

simple + ratio test: 0.741869

MOPS + SSD: 0.887964

MOPS + ratio test: 0.700639

 

After finding the AUC values of the other files as well (wall, bikes, and leuven) the average values for each are as follows:

Averages

Simple + SSD: .63909

Simple + ratio test: .56983

MOPS + SSD: .820318

MOPS + ratio test: .6822896

 

TGA Files

Below are the .TGA files that were generated when computing the Harris features:

             

                                                GRAF                                                                                                             YOSEMITE

Overall, our feature detection and feature description runs relatively smoothly. The code is able to detect features and apply the MOPs descriptor in an efficient manner. However, in the ROC curves the matching using SSD showed much better results then matching with the ratio. Using the ratio to compute the matches should be better than using the simple SSD. Therefore, our ratio matching may not be completely correct.

 

No extra credit assignments were able to be completed.