CS 194-26 Project 4b: Autostiching

Donglei Cai

IMPORTANT Note: Due to the fact that there's a file upload limit, I can't showcase all the possbile images at all different stages, so I am only showcasing images just for 1 specific mosaic. I have uploaded all images generated at all stages to gradescope so feel free to check them out!!

Harris Point Dectection

To compute corners, we used the function provided to find harris corners in the picture. I changed the sigma value from 1 to 3 in the corner_harris method to reduce the number of corners. Below are images with Harris Points on them.



Adaptive Non-Maximal Suppression

We use Adaptive Non-Maximal Suppression to filter all the harris corners to get strong yet spread out points, which we would later use to compute homography.



Feature Descriptor Extraction

Once we've shortlisted a bunch of points, we want to extract feature descriptors from them so they can be matched later. To extract features, we first perform a gaussian blur, then extract a 40x40 patch around each point. From this patch, we then sample every 5th pixel to create a representative 8x8 patch that represents each feature.


kitchen random 40*40 patch 1


kitchen random 8*8 feature descriptor 1


kitchen random 40*40 patch 2


kitchen random 8*8 feature descriptor 2


living room random 40*40 patch 1


living room random 8*8 feature descriptor 1


living room random 40*40 patch 2


living room random 8*8 feature descriptor 2


living room random 40*40 patch 3


living room random 8*8 feature descriptor 3

Feature Matching

Now that we're able to extract features from each image, we can then use the algorithm to perform feature matching on 2 images. For each feature in image 1, we shortlist the top 2 matching features in image 2, NN1 and NN2. To select our features, the criteria used for selecting points is that the ratio of diff(feature, NN1)/diff(feature, NN2) is smaller than some threshold.


kitchen 1 feature


kitchen 2 feature

RANSAC

With a list of potential matching points in both images, we can then eliminate outliers by performing RANSAC. In each iteration, we choose 4 random pairs of matching points, compute a homography, then measure the accuracy of our homography by applying it to all our other shortlisted points. We then store all the inliers to compute the final homography!


kitchen 1 RANSAC


kitchen 2 RANSAC

Blend the images into a mosaic

Now can we blend some images together to produce a mosaic!! I used alpha blending along with Gaussian filters to remove edge artifacts! The result looks really good! I see no significant difference between the mosaic I produced in project4a and project4b.

Project 4a Kitchen Mosaic Project 4b Kitchen Mosaic
Project 4a Living Room Mosaic Project 4b Living Room Mosaic
Project 4a Counter Mosaic Project 4b Counter Mosaic

The coolest thing I have learned from this project so far is that getting homography using automated methods is relatively fast and easy. It can save someone so much time by automaticlly finding features! I'll sure use this in the future when I need to stitch images together :))