You Jia (youj)
In this project, we are going to align together photos of a same scene, but under different filter settings, to restore a color image.
For low resolution images, the simple method that tries through a fixed range of offsets is used. And the sum of squared differences (SSD) on the gradients is used to measure how well two images match against each other. For high resolution images with possibly large offsets that make this simple method unaffordable, recursive pyramid matching is adopted to gradually polish the alignment. And for efficiency reasons, the SSD of intensity is used instead of that of the gradients. In both cases, only the center 80% part of the whole image has been used in the alignment process, since edges are likely to contain random things that are not supposed to match at all.
To crop out unuseful margins, I tried a weird arbitrary way of doing this which turned out to be reasonable. Take the upper edge for example, it will first find the worstly matched row among the top 10% rows, in terms of the SSD measure. Then it tries to go further down if the row below the current one has an SSD that is larger than 80% of the worst value just found. Then we will just cut the image at the row where it stops.
Example of the data we are going to process: three pictures of a same scene, taken behind glasses of different colors.
Offsets used to align the channels can be found here.
colorized image | after cropping |
---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Offsets used to align these high resolution images can be found here. The results shown below are all after the edge cropping.