In this part of the project, we create panoramas from multiply photos by using the homography transformation to rectify images in the collection to a singular perspective, and then we blend the images together to create a panorama. Most images here were taken by myself on UC Berkeley's campus.
To obtain the homography matrix, we manually label corresponding points between images, and then use least squares to calculate the elements in the homography matrix. We formulate the homography matrix transformation into a least squares problem to do so, solving for a through h in the homography matrix, as i is already known to be 1.
For image rectification, we identify the set of points we want transformed, and by taking the transformations of the four corner points, we know the range of points that our image will be transformed to. Knowing that, we use the inverse of the homograhpy matrix to perform inverse warping. Below is an example of image rectification.
Using the previous parts, we combine them to form a mosaic of multiple images. To get rid of artificats that come from combining photos, we can blend them with weighted averaging by creating masks that have values depending on how close to each image's center the common point is and then blending using the masks (center weighting). We can also use laplacian pyramids on top of this as well.
The most important thing I learned from this part of the project is that blending requires coming up with the right approach, which in this cases requires a 2d mask in order to get rid of both horizontal and vertical artifacts. The coolest thing I learned from this part of the project is how homographies can be useful to get interesting views of a certain part of the image, such as floor tiling as presented in lecture.