CS194-26 Project 6A - Mosaics & Homographies
by Max McArthur
There were five major parts to this project:
-
First of all, we needed to detect corners of the image. The provided code made this relatively easy; when using the code in practice, I adjusted the minimum distance between points to something more reasonable (i.e. 10) to make sure that points weren't extremely close together.
-
Feature descriptors: for each point extracted above, I extracted a 41x41 region, which I resized down to an 8x8 region using skimage's resize function, normalized and stored.
-
Feature matching: given all the feature descriptors from one image and another image, I used the given function, dist2, to create a table of "distances" between patches. This gave me an idea of what patches best match each other. As a way of thresholding, I only took patch correspondences where the ratio between the first- and second- closest matches was at least 0.5. This ensures that our confidence in each match is relatively high.
-
Selecting points for homography: given the matching features, I used the RANSAC algorithm to choose a set of points to use for homography as done in part 1.
The results were fairly good -- some points tended to be a little off and it seemed that the points to be used in homography seemed to always be in a small area which didn't ensure consistency throughout the whole image. I am, however, satisfied with the results:
Left Image
|
Right Image
|
Panorama/Mosaic
|
Part 1 Mosaic (if available)
|
|
|
|
|
|
|
|
|
|
|
|
-
|
A lot of the hard work in this project for me involved data structure management; it wasn't technically that difficult to manage, but there was a lot of difficulty in remembering exactly what each data structure represented (for example, the given code would return points in 'y/x' terms but the mosaic code I produced for the last part was based in 'x/y'). I did, however, find it fascinating that such technically simple code could yield such quality results; the RANSAC algorithm was such a brute-force attempt but it returns very effective results.
I did, however, have some issues with specific images. I'm still not quite sure why, but it seemed that when I would use images that worked fairly well for part 1, it would not find enough quality correspondence points to complete a mosaic.