Image Warping and Mosaicing

We take two photographs from the same position, just pointing in slightly different angles. Then a perspective/projective transformation can be used to transform one photograph into the other. This transformation is called a homography. Essentially, homographies can transform a rectangle to any arbitrary quadrilateral. Given two photographs, we can find their homography by hand selecting their corresponding points. Using homogenous coordinates, we use least-squares to find the 3x3 matrix that best transforms one set of points into the other.

Rectification

I know that the top surface of my Rubik's cube is a square. Thus, I can compute a homography to warp the image so that the top appears to be square.


I wonder what building this is? Since the concrete block that the text is on is rectangular in real life, I can warp the image so that this block appears rectangular, which makes the text easy to read.

Image Mosaicing

After selecting correspondence points between two images, I can use least-squares to compute the best homography between these points. Using this homography, I can warp the images so that they appear from the same perspective. I blend the warped images together by assigning each pixel an alpha such that pixels from the center of the original image have a large alpha while pixels near the edge have small alpha. This allows us to seamlessly stitch our two images together into a mosaic.








What I learned

I learned what homographies are and how we can use them to view images from a new perspective, as well as combine them.