I used the pictures I took on vacation in Porto, Portugal for the rectification part of the project. The first is the facade of a famous bookstore, Livraria Lello, which is where JK Rowling got inspiration for Harry Potter when she was living in Porto. The second is a wall of Sao Bento station that is famous for their blue tiles. For the image mosaicing, I took pictures of my neighborhood, my bedroom, and my cat.
Using n point correspondences from two images, I computed the entries to the 3x3 matrix H by setting up a linear system of 2*n equations. A * h = b. Then, I reshaped h to be a 3x3 matrix, H, and used this to find the coordinates that each input pixel would map to after being warped.
First, I warped the corners of the image using the homography to see how big the output image needed to be. Also, this calculates the offsets needed to translate pixels in the second image space to the resulting image space. Then I took all the pixel coordinates within the corners in the resulting image space and applied inverse warping so that there weren't any holes in the resultting image. What this means is that each coordinate in the resulting image has a corresponding coordinate in the input image which can be calculated using Inv(H).
For the Livraria Lello picture, I chose point correspondences so that the front face of the building is frontal-parallel. For the Sao Bento station picture, I chose point correspondences on the four courner of the colorful top banner, so that the banner would be frontal-parallel. Here are my results for image rectification and cropped to the area of interest: