CS194-26 Project 5 Part A: Image Warping and Mosaicing

Sairanjith Thalanki | 3032739634 | sthalanki@berkeley.edu | cs194-26-adm

Part A

Shoot the Pictures

Mosaic Image: Outside Left
Mosaic Image: Outside Right
Rectification Image: Betty Crocker Mix

Recover Homographies

In this part, I computed the H matrix which has 8 degrees of freedom using 4 points labelled on both images. I computed H by solving the following system of linear equations.
Stack the below 4 times for each of the 4 point correspondences:
P = [-x_i, -y_i, -1, 0, 0, 0, x_i * x'_i, y_i * x'_i, x'_i], [0,0,0,-x_i, -y_i, -1, x_i * y'_i, y_i * y'_i, y'_i] H = [h1, h2, h3, h4, h5, h6, h7, h8, h9]^T PH = 0

Image Warp

I used the H matrix calculated above to do an image warp. First, I applied H on the vertices of the source image in order to find the bounding box for the transformed image. Next, I iterated through the pixels of the destination image and colored them based on the interpolated points from the source image.
Outside Right warped to Outside Left shape

Image Rectification

For this part, I marked the points of a rectangular image and then warped the image into a square shape.

Mosaic

Using the image warped images and some blending, I was able to get a mosaic.

Part B

Harris Corners

Harris Corners were implemented by the amazing Prof. Alyosha Efros and/or amazing course staff. These points are very distinct compared to their background based on the gradient change. Some changes I made to the starter code were to use min_distance of 15 in order to reduce the number of points outputted so that anms would run in a reasonable amount of time.

Adaptive Non-maximal Suppression

Next, I used the adaptive non-maximal suppression technique (which ran very slowly before the aforementioned optimization). This part works by taking only the maximum point for a certain radius in order to ensure that there were sufficient keypoints throughout the image and not just in one noisy patch.

Feature Descriptor

I took the 40 pixels surrounding the pixel of interest, applied a gaussian blur to the region, downsampled, and normalized in order to get a 8x8x3 descriptor of the region.

Feature Matching

Next, I compared the features and created pairs when 2 keypoints were the best match in terms of SSD error.

RANSAC

RANSAC goes through random sets of 4 keypoints, determines the corresponding homography & the keypoints associated with that homography, and then determines which has the max number of inliers. We then compute a homography based on the max inliers.

Auto-Moscaic Final Result