Eilam Levitov - cs194-26-acx
This notebook runs on python 2.7
A Homography is a linear transformation (3×3 matrix) that maps the points in one image to the corresponding points in the other image. Homographies, and linear transformation in general, are an extremely versatile tool, as we will demonstrate in this notebook.
Consider a set of corresponding points $(x_1,y_1)$ and $(x_2,y_2)$ in two (potentially overlapping) images. Then, the Homography operator $H$ maps them in the following way:
In this part of the project (6A), I will manually select corresponding points in order to solve for the H matrix, which I will later apply on one of 2 over-lapping images to generate a mosaic.
In the first part of the project, I will transform an image of Prof. Efros next to the projector screen to make the screen square. This will rectify
the image, or more colloquially change the angle of point of view.
# Load image to be rectified
# Set up coordiantes for square
# Load preselected points for image
# Generate Homogarphy
# Wrap image
# THROW BACK
In this part we get to the real juicy part - creaing a Mosaic/Panorama.
In this first example, I will show a simple demonstration of creating a panorama image from of my apartment's study room.
# Load initial 2 images and display
# Load preselected points for images
# Generate Homogarphy
# Wrap image
# Creating naive-blend mask
# Naive blending
# Creating multires-blend mask
# Multiresolution Blend
# Cropped display
laugavegur
trail¶In my second example I will use images from a trek I did over the summer in north-west Iceland.
As a side note, I highly recommend this trek! Feels like you're on Mars crossed with jurassic park :~>
# Load initial 2 images and display
# Load preselected points for images
# Generate Homogarphy
# Wrap image
# Creating mask
# Naive blending
# Loading pre-generated multires-blend mask
# Multiresolution Blend
#### Cropped display
In this project I have learned the power of homographies and projective geometry. To be able to change prespective
using simple linear operations is amazing to me, and I'm convinced it will come very useful in the future!