The goal of this assignment is to perform image warping with a “cool” application -- image mosaicing. I took two or more photographs and create an image mosaic by registering, projective warping, resampling, and compositing them. Along the way, I learned how to compute homographies, and how to use them to warp images.
The homography transformation is the same as the following, where H is a 3x3 matrix with 8 degrees of freedom (i is set to 1).
To recover the homography, I select a set of (p’,p) pairs of corresponding points taken from the two images. Then I reformulate the 8 parameters, into the following matrix and use least squares to approximate these eight variables:
This step is to “rectify” an image. I took a few sample images with some planar surfaces, and warp them so that the plane is frontal-parallel. To perform this, I first select four corners of the rectangular object in the original image. Then I self define their corresponding target points as a frontal-parallel rectangle and solve a homography matrix to a line-parallel output image. Once the homography matrix is solved, I warp the images using the homography. Here are three results using homography image warping:
Notebook
TV
Bookshelf
Rectified Notebook
Rectified TV
Rectified Bookshelf
For each scene, I took three pictures. Then expand the middle picture as my background image, and warp the left and right pictures into the middle picture. For each wrap, I select 20 corresponding points from each image and compute the homography matrix with least square method.
I use linear blending to blend the left and right image. I first find the overlap part of both image, and perform a linear mask on the over lap part. Then I combine the linear mask with the mask where only right image is nonzero. The following is an example mask the the output image. I find that linear mask behaves very good in this case:
Example Linear Mask
Output after the Linear Mask
Left
Middle
Right
Complete Mosaic
Left
Middle
Right
Complete Mosaic
Left
Middle
Right
Complete Mosaic
HTML/CSS for this page was taken from
https://v4-alpha.getbootstrap.com/components/card/