CS 194-26 Project 5: Image Warping and Mosaicing

Part 1: Image Warping

Homography Calculation

Following the formula in the lecture slide, I created a "computeHomography" function that takes in 2 sets of coordinates, and returns a matrix H that when multiplied by coordinates, warps them into the specified shape.

Rectification

Using code that was similar to project 3 (face warping), I took the points within the polygon of the object I wanted to straighten out (in this case, a Stevie Wonders album), and multiplied them by the H matrix. I used normalized, and used these points to index into the original image, with new output coordinates. Here are my results.

Mosaicing

Warp the images so they're registered and create an image mosaic. Instead of having one picture overwrite the other, which would lead to strong edge artifacts, use weighted averaging.

Here are the original images

Whats the most important/coolest thing you have learned from this part?

I learned about the homography matrix and how it can be used to rectify an image. I did not know about these calculations beforehand, and it was interesting to see how simple it was. However, I would like to try it again with a more streamlined process using cv2 functions that we were not allowed to use.

Part 2: Feature Matching for Autostitching

Harris Corners

Points generated by the Harris Interest Point Detector

ANMS

Points generated by Adaptive Non-Maximal Suppression

Feature Matching

Points generated by Feature Matching

RANSAC

Points generated by RANSAC

Final Output