Project 4A: Abel Yagubyan

Shooting the Pictures

I attempted to take helpful images using my phone, however, the results were very suboptimal and not the greatest looking ones. Hence, I went ahead and used demo images from the dataset found in the following link. Here are some images below (image on the left is the left side, image on the right is the right side).







Recover homographies

I essentially recovered the homographies using the least squares method between the images, where I set up 4 and more correspondences between the images to use. By using these n amount of correspondences between the images, we were able to retrieve the H column vector (hence, 3x3 matrix) by solving the following equation below (also by allowing h_33 to be equal to 1). The equation was taken from the following link.



For instance, the H matrix for the first set of images above was equal to:

matrix([[ 1.18320210e+00, -1.36211424e-01, -3.66973729e+02], [ 1.15603031e-01, 9.22285758e-01, -5.38680254e+00], [ 4.89096096e-04, -5.48078324e-04, 1.00000000e+00]])

Warp the images

I wrote the warping function that essentially takes both of the images and the homography matrix as inputs, which then was applied to inverse warp to transform the second image into the base first image (by using cv2.remap), which were then placed next to each other and blended together as a final result.

Image Rectification

For testing purposes, I attempted to apply the rectifying technique on some images by warping some of the 4-sided objects to a "target straigtened" correspondence of the same object, which essentially straightens the object. Here are some examples (left side is original, right side is rectified version).









Blend images into a mosaic

For the blending purposes of the mosaic, I used the warping function to smoothly combine the images by mapping the second image to the first, which was then blended together as a final output. As visible in the last 2 results, the images were not perfectly aligned due to the definition of the correspondences, however, the approach is still the same and produces pretty good mosaics as a result.







Summary

I personally really enjoyed this project due to the very cool results captured using the techniques brought up in lecture.