Quinn Tran (abu)
To compute homograph transition matrix, I selected correspondence points from 2 image manualy. I use at least 4 pairs of points to solve for H:
Don't forget to divide w (or the third dimension of the transformed coordinates) to get x', y'.
Warp the image into the plan we want using our calculated homography matrix H. Here, I warped images to the target image/plane that was going to be the center of my mosaic. My target image is the middle image. An inportant step was to compute the boundary of the bounding box via the 4 corners of the unwarped image.
Before
After
Before
After
Before
After
I first started to combine two images as a time, having the middle image in each scene as the target perspective. I used cv2.warpPerspective with my image, calculated H, and warped bounds to calculate a mosaic of 2 images. Then, we only have to set a certain area of the warped image with the pixel values of the target image. This only worked when the right image was being warped. I had a hard time manipulating my bounds so that a warped image on the left would also line up with the target image on the right. In this case, I first created masks of the region of interest for each image. Then, I used linear blending (a linear combination) on the regions of interest for both images to create the resulting image. It was tricky getting the bounds correct to align in this case.
I combine my left and right mosaics to create a panorama via 3 images. I use the bounds of the target image from each smaller mosaic to align both the left and right into the panorama. Once again, it was tricky getting the bounds of the target image (from each smaller mosaic) to line up and have the rest of the picture "look right". Various reasons are explained below.
Overall, I still think they lined up pretty well. More correspondence points and less user error during manual picture taking would have been nice.
This project was super cool and confusing because I kept using the forward verses backwards homography H. I also got a better intuition of filters and pixel value interpolation to make a mosaic. I didn't expect a warp to create such a focused image (bounded by correspondences). It would be interesting to try more clever ways to mosaic more than 2 images together.