Image Warping and Mosaicing
by Kimberly Kao cs196-26-aas
Given two images taken with the same center point but rotated, we can use homography matrices to implement a perspective transformation. Here is the algorithm for warping im1 to im2.
Results
Im1
Im2
Warped Im1 to Im2
Using the above warping algorithm, we can "rectify" images by warping an image's correspondence points to the corners of a rectangle [0,0], [0,1], [1,0], [1,1] (this can be scaled according to the desired output size).
Le Petit Prince
French Soap Box
After implementing the warping algorithm, we can produce a mosaic by warping one image im2 to reference image im1, keeping im1 unwarped. When we warped the four corners of im2 to calculate the output size, we also calculated the translation offset of this image relative to the reference image. By doing this, so we can simply stack the two images on top of each other to produce a mosaic.
Results
Im1 Warped
Im2 with Offset
Mosaic
Im1 Warped
Im2 with Offset
Warped Im1 to Im2
Im1 Warped
Im2 with Offset
Mosaic
From doing this project, I learned the magic of homography matrices to change perspectives on images! I also learned how important good correspondence points were.