Rectifying Images

For this section, we calculate a homography matrix using 4 points in the given image. The "secondary" image we choose is the same photo but we select 4 points that we want the currently slanted rectangle to ultimately transform to. Using these 4 correspondences, we compute the H matrix and use that to transform the pixels in the original image to their final, rectified destination.

mirror mirror_r
Bedroom mirror (left) and the same mirror rectified (right)
poster poster_r
Robinhood flyer (left) and the same flyer rectified (right)

Image Mosaic

Building on the concept of rectifying images from the last section, we do a similar transformation, this time with actually different photos. We take photos of one scene keeping one area in the overlap between the two consistent. That area defines the correspondences between the two images, and we rectify one to the perspective of the other, then use a simple linear blend to combine the two into a panorama.

sproul_c sproul_l
Input images of Sproul Hall
sproul sproul_cropped
Sproul mosaic, cropped.
closet_c closet_l
Input images of my closet
closet closet_cropped
Closet mosaic, cropped.
bedroom_c bedroom_l
Input images of my room
lower bedroom_cropped
Room mosaic, cropped

Learnings

This was a pretty cool project! I learned that finding the transform between 4 correspondences on 2 photos is extensible enough to be applied to the rest of the points in the photos to create a mosaic.