# Project 6 Part 1: Image Warping and Mosaicing

## Taking photos

I took photos trying to ensure lighting was uqal and sure not to translate the campera between photos, keeping a 30-60% overlap.

## Calculating Homography

I calculated the homography matrix required to transform one image to the alignment of the other by solving a system of linear equations with least squares. I solved the following equation, where the original point is (x, y) and the point it aligns to is (x', y'), where every two rows of the large matrix corresponds to one point. We are solving for the values a11-a32 which are the first 8 values of the homography matrix (the last of which is 1).

## Warping

I calculated the final image shape by multiplying the coordinates of the corners of the image to warp by to homography matrix and then offestting the coordinates in side this quadrilateral so they were all positive. I performed inverse warping, i.e. for each point in the destination polygon, we multiply it with the inverse of the homography patrix to obtain the corresponding point in the original image and sample it.

## Stitching

We stitch the images together either by using an element-wise max of the two images or the Laplacian/Gaussian pyramid from project 3.

## Soda 7th Floor

### Blended

Blended by taking maximum for each pixel.

## 606 Soda

### Blended

Gaussian blending.

## West Campus

### Blended

Gaussian blending.

## What I Learned

I learned that taking good pictures is really important for mosaicing! Having consistent lighting is important so that stitching takes minimal work to not appear to have seams. In addition, not translating the camera while taking pictures is important as well to avoid inconsistent panoramas. Having more correspondence points is also useful so that human error in selecting them is minimized (i.e. the final homography and translating/stitching of the image involves solving a least-squares equation or taking an average and so human error is averaged out).