CS 194-26 Project 4a

Image Warping

Angela Liu

Overview

In this project, I played around with different image morphing techniques involving warping and interpolating colors to combine multiple images.

Shooting Images


Points
Whitsundays 1
Average Triangulation
Whitsundays 2
Points
Meteora 1
Average Triangulation
Meteora 2
Average Triangulation
Santorini 1
Points
Santorini 2
Average Triangulation
Santorini 3

Here are the images I shot during some of my favorite vacations. Each of them shows a scenic view from a slightly different perspective.

Recovering Homographies



Here are the point correspondences that I selected for the input images.
Points
Average Triangulation
Using these points, I calculated the homography matrix. To do so, I set up a system of equations where I created a matrix A and b and solved for the appropriate 8 degrees of freedom. The matrices I created looked like the following where x and y are the points of image 1 and x-hat, y-hat are points in image 2:
Points
matrix A
Average Triangulation
vector b
With these two matrices, I set up the system of equations Ah = b. Since I had a lot more points (> 8) than necessary, the system of equations might not have an exact solution so I used least squares to solve for the best vector h. I then added a final value of 1 and reshaped h to create the final appropriate homography matrix. The following image shows the resulting H matrix which I created using the above two images and correspondence points.
Average Triangulation

Warp the Images



I decided to warp my second image onto the first image. To do so, I multiplied the coordinates of my second image with the inverse of the homograpy matrix and then performed remapping/interpolation of the image to project the appropriate colors onto the new basis. The result was as follows:
Points
Original 1
Average Triangulation
Original 2
Average Triangulation
Image 1 projected onto image 2's correspondence points

Rectify



For rectification, I chose two images I took at the Getty museum that were not completely front-facing. The original images come at a slight tilt and I selected the edges of the potrait frame and ceiling window respectively and projected both onto a straight rectangular region to make the image appear front-facing. The result was quite nice!
Mean Dane
Original image
My face morphed onto mean Dane
Rectified image
Mean Dane
Original image
My face morphed onto mean Dane
Rectified image

Blending into an image mosaic


Points
Whitsundays 1
Average Triangulation
Whitsundays 2
Points
Whitsundays blended


Points
Meteora 1
Average Triangulation
Meteora 2
Points
Meteora blended


Average Triangulation
Santorini 1
Points
Santorini 2
Average Triangulation
Santorini 3
Average Triangulation
Santorini 1 & 2 blended
Points
Santorini 2 & 3 blended
Points
Santorini all blended

Here are three blended mosaics that I created. In each case, I projected one of the images onto the other image in order to have a stable point of correspondence to project upon. For the final three-way blend, I also projected each image onto its neighbor iteratively.

What I Learned



I thought this project was super cool because it was very interesting to learn about homographies and image projections as a method of warping. Previously, we had worked with morphing images which used smaller projections of triangles but I thought it was very cool that I could actually use correspondence points to warp an entire image into providing a new perspective just by matrix transformations. I also thought it was really cool that I was able to use a lot of the knowledge that I learned in the last two projects with morphing and transformations and apply them in a new setting where I was able to create cool blended images that stitched together multiple perspectives.