In this project, we implement automatic stitching for panorama photos. Specifically this requires implementing feature detection (via Harris corners), Adaptive Non-Maximal Suppression, feature matching (with Lowe thresholding), RANSAC, and finally image warping. See below for the results.
Below are the results of Harris corner detection and the Adaptive Non-Maximal Suppressed Harris corners. You can see that the non-suppressed Harris corners follow the detail in the image.
Detected Harris corners. |
ANMS-ed Harris corners |
We use downsampled 8x8 patches around each feature to match features between images. Sample patches shown below.
Feature pairs are Lowe thresholded and the paris of features with the smallest SSD error are chosen for homography computation. To compute the homography, we use RANSAC to pick a set of inliers to compute the homography matrix from.
Below we see the images that I manually annotated with points for stitching. I added many points and tried to follow lines in the image.
The results are without alpha blending and with parameters for matching tuned as best as I could get them.
city0 + city1 |
city1 + city2. Roof tiles match but the skyline is having some issues. |
clake3 + clake4. |
It was cool to learn how feature matching / outlier rejection is implemented! I use a MATLAB function for SIFT feature matching for research so learning about this gives me some ideas about how to improve my other scripts.