Welcome to the webpage for Kevin You's submission for project 1.
I use a search range of 15 pixels in both directions on the smallest image in the Gaussian pyramind, where the smallest image has size at most 200x200 pixels, and the images are downscale by a factor of two in the pryamind. Such a dramatic shift is needed in the self_portrait image. In the higher levels of the pyramind a search range of 3 pixels is used.
For computing the alignment shift, I cut 10 percent of the image around all four boundaries to avoid the black stripe. I keep the entire image for the output. I normalize the channels to mean 0 and standard deviation 1 before computing the Sum of Squares difference and the cross correlation. Both metric gives the exactly same results, except for red and blue channels of emir. The results were also within one or two pixel of the results when the channels are not normalized, again except for emir. The normalized SOS worked best on emir.
The algorithm takes roughly 2s to run per image for the 3000x3000 images in the collection
For debugging, it is convinient to display a map of the SOS/correlation values, as well as the difference of images for SOS. If the map has vertical stripe-like patterns, it is likely the black boundary interferring (figure 1). If the map's minimum appears outside (figure 2), it means that a larger search range or more pyramind divisions is necessary. A clear minimum is good (figure 3).
| Image | Green offset | Red offset |
|---|---|---|
| train | 42,6 | 87,32 |
| three | 55,14 | 112,11 |
| self | 79,29 | 176,37 |
| emir | 49,24 | 102,57 |
| harvesters | 60,17 | 124,14 |
| lady | 55,9 | 117,11 |
| village | 65,12 | 138,22 |
| turkmen | 56,21 | 116,28 |
| icon | 41,17 | 89,23 |
| cathedral | 5,2 | 12,3 |
| cannee | 61,-11 | 125,-23 |
| rosebushes | 75,15 | 160,29 |
The colored images are shown below.
For bells and whistles, I chose to compare the gradients of the channels, again normalized with a SOS difference. More percisely, I comapred the gradients obtained by using two Sobel filter for the two partial derivatives. I was worried that when applied to the blury downsampled images, the results won't be that good. However, results turned out quite well. For most images, the offsets were within three pixels of the previous, so I only show the ones with a larger difference. Even so, the differences were hardly noticable, except for Emir.
| Image | Green offset | Red offset |
|---|---|---|
| train | 41,2 | 85,29 |
| emir | 49,24 | 107,40 |
| rosebushes | 77,20 | 160,29 |
Emir is fixed!