Note: I just reuploaded this on 11/13 because I accidentally replaced it with a project 5 website :(

CS 194-26 Project 4A

Image Warping and Mosaicing

Angela Xu

Overview

For this project, I took some images around my apartment at different angles to stitch together into mosaics!

Shooting the Pictures

I made sure to shoot pictures with overlap, and tried to keep exposure consistent.

Here is one set of example images!

r1 r2


Recovering Homographies

To solve for the homography matrix, a 3x3 matrix with 8 degrees of freedom, I defined 8 correspondence point pairs (p', p), and solved for p’=Hp.

mid

Here is an example of correspondence points:

p1 p2


Warping the Images and Image Rectification

Now we can apply the homography matrix to warp our images! As a sanity check, I first tried to rectify a picture frame.

f fr

It works! Now, I will be able to warp the other images.


Blending images into a mosaic

Using the homography matrix and my warping function, I stitched together three sets of images. I first found the homography matrix between left and right, then warped the right side image adding padding, and finally combined the images together, averaging values in the overlapping areas!


r1 r2 r2


d1 d2 r2


A horizontal one!



r2

What I learned

In this project, I learned how panoramic pictures are created! I also found how important precision is when choosing correspondence points, as slight differences can really affect how images line up (this is evident in some of my results, because I could not perfectly select points in ginput). This has been very fun!

Project 4B

Feature Matching for Autostitching

Detecting Harris Corners and ANMS

I used the function given to find Harris corners on my room image.

There are many points, so we use Adaptive Non-Maximal Suppression to choose a stronger subset of all the points.


Extracting Feature Descriptors

Now that we have our corner points, we get 8x8 patches of the features of each point. We get these from blurring and rescaling 40x40 squares.

Matching Feature Descriptors

We get the feature descriptor patches for each images corners, and then through finding the minimum SSD between features, we match them.

Here are some example matches from our first image!

RANSAC

We used RANSAC to compute homographies by taking a random sample of 4 points, computing the homography matrix, finding the distances between transformed points of image 1 and actual points of image 2, and appending these as "inliers" if the distance is below epsilon. This is looped over 1000 times, and homography is then determined by the maximum number of inliers.

Mosaics

Here, we compare the before and after of manual/auto mosaics!