Image Warping and Mosaicing

Michael Huang

Part A

Shoot the Pictures

Angle A Angle B
Angle B Angle C
Angle A Angle B

Recover Homographies

Homography Matrix Solving for H

To solve for H, we set a linear system of n equations. Though there are only correspondences in the image above, more than 4 correspondences can be provided and solved using least-squares to make a more robust homography.

Warp the Images and Image Rectification

I rectify two images, to make the plane frontal-parallel. For the first image, I chose to make the right walk-way frontal parallel. For the second, I made the wall frontal-parallel. Besides just applying the homography, I also have to translate the image so the whole image is captured and negative x/y values are fixed.

Orignal Rectified
Orignal Rectified

Blend the images into a mosaic

I warp my images one by one, slowing growing my mosaic. I find the combined image bounds to create the final image's size, and translate them to the correct position. To merge the edges together nicely, I applied some simple feathering where the alpha falls off linearly at the edges.

Angle A Angle B Combined
Angle A Angle B Combined
Angle A Angle B Combined

Tell us what you've learned

I learned that over-defining the feature points are the most crucial factors to creating a clean mosaic. When I selected points that were too close to each other, a small error could result in a massively incorrect homography and transformation.

Part B: Feature Matching for Autostitching

Harris Corners

I used the sample harris.py code to generate harris points for my images. I get around ~3000 points per image.

Angle A Angle B

Implement Adaptive Non-Maximal Suppression

I then implemented ANMS by computing the minimum squared distance for each harris point in c to another point in c where H_point < 0.9 * H_other. I took the top 500 points whose minimum squared distance were the largest, to create a distribution of harris points across the entire image.

Angle A Angle B

Feature Extraction & Matching

I implement feature descriptor extraction by extraction a 40x40 patch around each harris point, and downsampling to a 8x8 patch. To match features, we use Lowe's thresholding, best distance / secondbest distance, and keep the ones whose ratio is less than the threshold 0.3.

Angle A Angle B

As we can see, the harris points that we are left are only in the overlapping portions of both images, and seem to be in the same locations.

RANSAC

I implement RANSAC as discussed in class, randomly subsampling a 4-point correspondance to create a homography, and using it to compare the other feature points transformed with the homography to their actual counterparts in the other image. I create a list of inliers by selecting only features with error below some threshold, which I set to 5. The homography with the largest set of inliers is the best homography estimate.

Manual Automatic
Manual Automatic
Manual Automatic

What have you learned?

The coolest thing I learned in part B was the feature descriptor extration and feature matching. Just looking at the harris points go down from the cluster of points to a small set of points where I could clearly see which points corresponded to which was very cool. Lowe's thresholding, in particular, was a very cool algorithm and definitely something I would not have thought of myself. I think the fact that some automatic mosaics looked even better than the one I manually made is very impressive.