Assignment 6: Panoramic part 1

Harry Ho, CS194-26-agg

Overview

This project was a general level-up from all the projects we've done so far. We're resizing images to stitch them together to construct a panorama!

Step 1: shooting and digitizing pictures

This part of the project was actually pretty difficult. I ended up scrapping a photo because I couldn't hand-pick any good correspondances

Step 2: Recovering Homographies

A homography matrix is a matrix that can calculate changes in projection. With this, we are able to reshape and warp images with multiple degrees of freedom. However, we need a minimum of 4 reference points per image.

To compute this, we have a large matrix with n rows and 9 columns, n being twice the total number of corresponding points. We then append a row of 8 zeros and 1 one to prevent our matrix from just being zero. We multiply that to get the zero vector, with one 1. This ensures that our ninth value in the matrix will always be 1, and we won't just multiply our matrix with the zero vector.

Step 3: The Good Warp

Wit this, we can warp our images to get rectilinear transformations. I used the exit sign and a photo from BAMPFA to straighten into a square. This was done by extrapolating the coordinates of our new image using the homography, and then, for every point, interpolating the new coordinates from our older image

original photo
warped exit sign
original picture
warped blue photo

Step 4: The Bad Blend

This is where I started running into problems. First off, I started my blending thinking that I was always going to blend from left to right. After all, my image warps took in a left value and a right value. For panorama's of two images, the difference was hardly apparent. But throw another image in, and lo and behold, I was truly done for. The images would go from bad to worse, and I'd end up with a trapezoidal image more than the actual aesthetic insta images.

My thoughts on this project

Once again, I shirked my duty for starting projects early, and ended up with yet another banger. Not understanding the use cases for image warping led to my somewhat unruly downfall. I will be sure to fix whatever I need to before part 2.