Feature Matching for Autostitching

Adaptive Non-Maximal Suppression

Using the given Python file, we find Harris corners. However, as seen below if we simply look for any curves or corners, then the potentially the whole image will be filled with these points. To prevent this, we try to find the best points that are also a certain distance away from each other.

Too many corners!
Starter Code Adjustment
10 pixels apart
15 pixels apart
25 pixels apart
50 pixels apart


Feature Descriptors

After we get our corresponding points, we try to get a 40x40 window around each point so that we can later compare these frames to get the best fit of corresponding points. After getting these 40x40 patches, we first apply a gaussian to smooth out our grayscale image. We then downscale the image into a 8x8 patch. That way, we take care of the high frequency details while still preserving the low frequencies. We then take care of the change of color intensities through bia/gain normalization.

Example 1
Example 2


Feature Matching

We again refer to the starter code to find and match the best corresponding points to each other. After getting the descriptors from the previous step, we apply the function dist2 so that we can find the best match for each corresponding point. We then only include feature pairs in which the best pair is significantly better than the second best pair for that specific corner. In our case, we set the threshold to be 0.33, and we divide the best value by the second best value.

Doe Left
House Left
Zellerbach Left
Doe Right
House Right
Zellerbach Right


RANSAC

Next we use RANSAC to find out which corresponding points are actually useful, and therefore can be used to create a homography matrix for the rest of the image. We first get all the sets of corresponding points we got from feature matching. Over 1000 iterations, we select 4 random corresponding pairs to create a temporary homography. We then count the number of inliers (points that differ from the expected image by a specific threshold or lower) from the rest of the corresponding points we get from this homography, eventually returning the set of inliers from the homography that produced that largest amount of inliers. We use this set of inliers to create a homography for the rest of the image.

Doe Left
House Left
Zellerbach Left
Doe Right
House Right
Zellerbach Right


Results

Using a simple weighted average blending algorithm, we get the following results!!

Doe
House
Zellerbach

Cool Parts!

This project was unique in that after we set up the algorithm, there is very little we as the user need to do. I appreciated the automatic aspect of this project, as it was the first time I created such a hands off project that can be run by itself as long as it is started. It also yet again made me realize that it takes very little conceptual knowledge to create extremely intelligent algorithms.