This was not an easy project! I hugely underestimated the difficulty of finding the homography. Initially, I thought that a solution similar to the one I found for project 5 would do the trick - but it created an affine transformation. I learned a great deal about transforming points in 3 dimensions and the importance of matrix operations and order.
For example, when you shift from coordinates in image1 to new coordinates to line up with image2, some coordinates will be negative. So there is a requirement to shift vertically and horizontally within the larger canvas to fit everything. Later, when adding pixels to the canvas, you need to be sure to reverse that shift to get to coordinates relative to your base image, then invert the transformation from image1 to image 2 to get back in terms of coordinates relative to image 1. Mind-bending stuff!
Not to mention the Singular Value Decomposition required to solve for H in the first place! This has been an intense weekend.
Taking the images was very fun!