CS 194-26: Project 4

Alexander Kristoffersen, akristoffersen@berkeley.edu

Recovering Homologies

To calculate the homography between two images, at least 8 datapoints (4 pairs of points from each respective image) is needed. To solve for the H matrix, I constructed this matrix:

Image courtesy of Yalda Zadeh

This is just the linear equations created when multiplying out the equation from applying the unknown H matrix to the input points, resulting in the output points. If there are more than 4 correspondences, I use LS to solve for the best approximation of H.

Warp the Images

Similar to how it was done in Project 3, once we create the homography matrix H, we can apply that transformation using inverse sampling!

Rectification

A sticker on the doorway of Lewis Hall:

The side of a box with a heart drawn on it:

Now on to mosaics:

Blend the images into a mosaic

Creating mosiaics is similar to rectification, except we can create any new coordinate system. The general idea I used is to first calculate the transformation from the first image into the 'canvas basis'. This was usually simple, either rectifying something in the first image or just a translation to the middle of the canvas. Then, every subsequent image is added by:

Soda Breeze Way

Result:

Andronico's Grocery

Result:

My Messy Room:

Result:

Bells and Whistles: Video!

I thought it would be cool to see if I could add a mosaic / rectification to a static video. Here are my two results of that:

Note: the quality looks fairly bad on these because of compression to fit them on the website.

Here is a trippy result I got from animating over different canvas coordinate systems!

Overall, this was a really interesting part of the project! I loved the fact that this was all done with a couple of matrix multiplications. Applying video was also extremely exciting-- I'm sure with automatic feature detection it would go a lot smoother and I won't be restricted to mostly static video!