Project 4A: IMAGE WARPING and MOSAICING

Shooting Pictures

bears

Left

bears

Right

bears

Left

bears

Right

bears

Left

bears

Right

Recover Homographies

I first select eight points that correspond with each other on each set of images.

bears

Left

bears

Right

bears

Left

bears

Right

bears

Left

bears

Right

Once I have the points, I can create a system of linear equations that is overdetermined and find the homography matrix with least squares.

bears

Warp the Images

Once I have the homography matrix and the points of the source image, I can transform the points onto the target image using

bears

Image Rectification

To test image warping, I can rectify a few images

bears
bears
bears
bears

Blend the images into a mosaic

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.

bears
bears
bears

The coolest thing I learned from this part was how to compute homographies in order to transform points from one image to another!

Project 4B: FEATURE MATCHING for AUTOSTICHING

Harris Corner Detection

Below are Harris corners detected on the images I captured in my apartment.

bears
bears
bears
bears
bears
bears

Adaptive Non-Maximal Suppression

I run ANMS to keep the top 500 corners for each image that are meaningful and well-distributed.

bears
bears
bears
bears
bears
bears

Feature Extraction and Matching

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.

bears
bears
bears
bears
bears
bears

RANSAC

I follow the RANSAC algorithm described in class:

  1. I pick 4 random matched points
  2. I compute the homography with these points
  3. I compute the inliers where dist(p_i', Hp_i') < eps
  4. I get the maximum set of inliers
  5. I recompute least-squares H estimate on all of the inliers

Below are my final points I use to create my mosaics.

bears
bears
bears
bears
bears
bears

Creating Mosaics

I create the mosaics using the code from part A but with the matched points from RANSAC.

bears
bears
bears

Side by Side (Left is Manual, Right is Automatic)

bears
bears
bears
bears
bears
bears

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.