# Project 6A: IMAGE WARPING and MOSAICING

## Overview

This project was using projective transforms to "rectify" images and create mosaics and panaromas. The steps were: shoot pictures, recover homographies, warp images, and blend images into mosaics.

## Pictures taken

Here are some pictures of linear interpolation with various C values

 Study room Outside Bechtel That hall next to Bechtel

## Recover Homography

This is the matrix H such that for each point p1 in image1 to its corresponding point p2 in image2, you can get the relationship p2 = H*p1. This is a 3x3 matrix that does the perspective transform on each point of the original point. To construct this H, I used eight corresponding keypoints between each picture for mosaics and four corresponding keypoints for rectifying images, since you just need a rectangle.

## Rectification

Continuing on about what I stated above, "rectifying" images involved finding 4 keypoints of a warped rectangle (let's say a piece of paper that is lying down on a table and the camera is looking at it from the side), matching those keypoints to a rectangle (let's say now you're looking at the paper from bird's eye), and warping. Here are some cool images!

## Pictures taken

Here are some pictures of linear interpolation with various C values

 Study room portion of the warped image. As you can see, I focused on the laptop and trying to make that a clear rectangle. Outside Bechtel portion of the warped image. As you can see, I focused on the candy case (I don't know the term) and trying to make that a clear rectangle.

## Blending into Mosaic

This is essentially what the previous steps (finding homography, warping) led up to. Now, we can blend images into a mosaic. One way that you can do this (which is how I did it) is to have two images, warp one image into the other (say im1 is the warped one and im2 is the unwarped one), and use classic blending techniques to create a mosaic from im1 and im2. You can do this through laplacian, average blending, alpha blending, or simple naive blending. I implemented laplacian, but my naive blending, which involves just putting two together in the simplest way possible, looked much better

 Study room Outside Bechtel Building next to Bechtel

## What I've Learned!

What I learned is just how iPhones create panaromas; as you turn it 360 degrees, the iPhone takes several instances of the photos with overlap and computes homography and just blends them together. This is pretty amazing.