In this part, the focus is on finding homographies between images and using them to project the different images into a single panorma like result.
To compute the homography, we first select correspondant points between the two images. Then we use these coordinates to find a projective transformation between the two by solving using least squares. The method used is described in this paper: Homography Estimation. I used 7-8 correspondants to pass into the function for every pair of images.
Using the homography from the previous part we first find the corner points of the image we want to warp. Then we can use inverse warping to interpolate the pixels to fill into the resulting image. The positions where there are no pixels from the original image are kept black.
Left side image warped to center image
Original center image unwarped
Right side image warped to center
To check that our homography and warping is working as we want it to, we can take an image of something that has a square shape then try to warp the points to a set of square coordinate we define. For example, in the image of the door below I chose the 4 correspondants which forms a square in the warped image.
Now that we have the images of our final mosaic, we can stitch them together by aligning them correctly in one final image.
I realized it was important to pick the correspondants well to get them to align better. I also discovered the importance of normalizing the coordinates by w to end up with the correct warping after spending a while trying to figure out what was wrong. I was also surprised by how well the images blended on its own without really needing to blend it.