**CS294-26 Project 5: Stitching Photo Mosaics** By Neerja Thakkar Part A: Image Warping and Mosaicing =============================================================================== Shoot the Pictures ----------------- The first step is to shoot some pictures that will be stitched into mosaics! I used an iPhone camera app that allowed me to lock exposure and aperture. These photos were shot in (the very cold) Minnesota, where I am living right now. ![](river1.jpg width=300) ![](river2.jpg width=300) ![](house1.jpg width=300) ![](house2.jpg width=300) Also, I did not take these photos of Mount Rainier, but I tested my method on them: ![](Rainier1.png width=300) ![](Rainier2.png width=300) Recover Homographies ----------------- In order to recover homographies, I first select 4-8 pairs of corresponding points on each image. We can set up a system of equations $Ah=b$, where $h$ contains the 8 unknown values in the homography matrix $H$, and $a$ and $b$ are formed from the corresponding points. This system is solved with least-squares. Warp the Images ----------------- Once we have computed the homography between two images, we can warp from the first to the second image. I used inverse warping for this part, very similarly to in project 3. Image Rectification ------------------- To test that solving for homographies and warping images works, we rectify some images. I took images of a painting and book that have a rectangular shape, defined a square/rectangle shape to warp them into, and then let my code turn them into perfect rectangles! ![input](IMG_2187.jpg width=200) ![rectified](out/rect_1.png width=300) ![input](IMG_2186.jpg width=200) ![rectified](out/rect_2.png width=300) Blend the images into a mosaic --------------------------- In order to blend images into a mosaic, I warped one image to align with the other, and then blended them using a Laplacian stack. Here are my results: ![Mount Rainier](out/blended_rainier.png width=600) ![House](out/blended_house.png width=600) ![River](out/blended_river.png width=600) Reflections ------------ I learned that the selected points really matter! At first, it seemed like my implementation was wrong, but I realized that I was just not clicking on points carefully enough.