I first select eight points that correspond with each other on each set of images.
Once I have the points, I can create a system of linear equations that is overdetermined and find the homography matrix with least squares.
Once I have the homography matrix and the points of the source image, I can transform the points onto the target image using
To test image warping, I can rectify a few images
I first warp the images using the homographies recovered in the earlier parts. Then, I use a mask to conduct linear alpha blending between the images.
The coolest thing I learned from this part was how to compute homographies in order to transform points from one image to another!
Below are Harris corners detected on the images I captured in my apartment.
I run ANMS to keep the top 500 corners for each image that are meaningful and well-distributed.
I extract a 8x8 feature for each corner on each image, downsampled from a 40x40 patch which is centered at each corner. Using these feature descriptors, I find the two closest features and use Lowe's trick to say if the ratio of the smallest distance over the second smallest distance is smaller than a threshold, then keep the corner. Otherwise, remove it.
I follow the RANSAC algorithm described in class:
Below are my final points I use to create my mosaics.
I create the mosaics using the code from part A but with the matched points from RANSAC.
Side by Side (Left is Manual, Right is Automatic)
The coolest thing I learned from this part was how to use RANSAC to filter out bad matches, and I realized that my RANSAC was returning the same point in one image for multiple points in the other image as a good match which was wrong. Therefore, I needed to edit my feature matching to remove non-bijective points.