Quinn Tran (abu)
In Part A, I calculated homographies of user-defined points to rectify images and blend multiple images together to create mosiacs.
We will implement MOPS - Multi-Scale Oriented Patches, as described in this paper. We first compute the Harris corners to detect every possibility of a corner using provided instructor code.
We implement ANMS with limit n=500 points, c=.9 by choosing strong but well space corners. I first find all possible points where h[center point] <= .9*h[any other point], where h[point] = harris corner strength of a certain point. I find the smallest squared Euclidian distance between center and a point in the described set using harris.dist2. This is the minimum suppression radius. I did this on all points and chose n=500 points with the highest suppression radii.
We give each point a descriptor. First blur the image by taking a 40x40 box around the center, then blurring things patch with scipy.ndimage.gaussian_filter(patch, sigma=1). Subsample this box every 5 pixels for an (8,8)->(64,) descriptor. Normalize the descriptor with I' = (I - mu) / std to make it invariant to intensity changes.
We use Lowe's technique to match descriptors. Take every feature descriptor in the image we want to warp and find the feature descriptor in the static image with the smallest SSD (1-NN). Then find the second best match (2-NN). We pick this match/pair of features (feature to warp and 1-NN feature) if (1-NN) / (2-NN) < e, where e=.3. In other words, we only keep the best match if the best match SSD is much greater than the next best match's SSD.
I used RANdom SAmple Consensus to compute "inliers" to take the final homography. RANSAC chooses 4 out of all the matched points randomly, and computes homography matrix H as in part A. Using H, compute the matched coordinates we want to warp to the perspective of the static image as in part A. Check how close the warped coordinates are to the matching coordinates in the static image. We score each homography H based on whether the SSD between the warped coordinates and those of the static image is < e. The number of inliers is number of coordinates that satisfy this condition. Keep the H with the largest number of inliers. iters=5000, e=2.
Automatically aligned mosaics were so much better than my manual-defined mosaics. It was interesting to see which points were most likely considered corners because of how the choice could defy my intuition. For example, in the image of handmade clay bowls my friend I made, anms points actually hovered on one side of the shelf, implying that the algorithm might also interpret corners at a higher granularity. It'd be nice to interpolate pixel values more intelligently to perfect a mosaic. It was super cool how some panoramas seemed "larger" or had more depth from changing which H would warp an image, thereby "adding" more perspective into the image.