Image Warping and Mosaicing

To Rectify an image into a projective mapping we take some keypoints then warp those keypoints to another group of coordinates. We can perform
a least squares regression to discover the best projective transformation for these points, then apply the transformation over the entire image by interpolating the image. This is my derivation of calculating the homography matrix from 4+ points.

We can apply the projective homography to some examples now!

Original

Rectified

Here, I chose points arround a neon sign then rectified them so you can see what the sign says more clearly. Notice there is a large dark border at the right side of the rectified image because there is no image data there to rectify.

Original

Rectified

Pic 1

Pic 2

Final Mosaic

The mosaics with trees/grass end up with some very high-frequency discrepency that makes the middle of the image look, for lack of a better visceral word, drunk. The bottom mosaic in a lab turned out horribly because I did not rotate the camera correctly when taking the images and the many objects are obviously not aligned properly. I've included them as a cautionary tale of what happens when you use this mosaic creator on bad images. Although, this could be an issue with the keypoints I defined so maybe the automated keypoint finder will fare better.