CS194-26 | Amy Huang
[Auto]Stitching Photo Mosaics

Part 1: Image Warping & Mosaicing

Part 2: Feature Matching for Autostitching

Part 2: Overview

For this second part of the project, I will be following the project “Multi-Image Matching using Multi-Scale Oriented Patches” by Brown et al. in order to autostitch the images together in a mosaic.

Detecting corner features in an image

I used the spec's function get_harris_corners(im) and finds all the harris corners in my image. Here is what the output points are:

As you can see, there are too many points plotted, so we will be using Adaptive Non-Maximal Suppression ANMS(coords, h, cap=500)

Extract a feature descriptor for each point

featureDescriptor(im, coords) Now that we have the points, we will implement feature descriptor extraction. To do this, we use a Gaussian blur on a 40x40 window of that point, and we downsize it to an 8x8 square and normalize it.

Matching the feature descriptors between 2 images

featureMatch(d1, d2, threshold)Next, we use the dist2 function and the feature descriptors. I used a loop to look through every descriptor in image 1 and iamge 2, and comparing the features together. The dist2 method allows us to measure how closely 2 features in the different images match together

RANSAC

The next part of this project is to implement a robust method (RANSAC) to compute the best homography estimate. We do this by selecting a random sample of 4 points to compute the homography matrix, and then repeatedly doing this for a number of iterations, and computing the SSD of the distance to determine if it is an inlier to keep. Here are the results of all of these steps put together to automatically stitch image mosaics together!

[LEFT] Handpicked points || Autostitched [RIGHT]

As you can see, the autostitching has eliminated a lot of the blurriness from my hand-chosen points. Here are some more that I took of my room, and it was very easy to run the code to auto-stitch them together!

Coolest thing I learned: I loved doing this project since panorama is super interesting to me and it's so incredibly cool to be able to implement this and actually create panorama portraits without manually selecting the points. At first I thought this project would require more neural networks but I didn't think it would be much less complicated than I thought!