This assignment seeks to align the RGB channels from the Prokudin-Gorskii glass plates.
This method seeks to align the RGB channels using exhaustive iterations of offsetting the image
by a desired range. An example input image looks like the following image below.
In order to obtain each of the RGB channels, divide each of the input images
in to thirds by the height, and each of the images can be used as R, G, B channels respectively.
The R and G channels are offset to align with the B channel.
To align the images more efficiently, the images were rescaled to be of smaller dimensions to make updates
from the coarsest scale. For higher dimensionality, this should be able to speed up the process as
while checking at larger offsets. The coarest level image is 1/8 of the actual image, and for each level the
images are rescaled two times the previous scale.
The following are the results from the single scale alignment method from a small jpg file.
File Name | SSD_single | NCC_single |
---|---|---|
cathedral.jpg | ![]() |
![]() |
For the larger tif files, I used image pyramid method. In addition to using the two different scoring schemes, I also used the Sobel filter before the adjustment to compare the performance. Note that emir.tif actually performs better with edge (Sobel) detection method whereas for for self-portrait, non-edge detection method (non-Sobel) aligns better.
File Name | SDD | NCC | SDD + Sobel | NCC + Sobel |
---|---|---|---|---|
emir.tif | ![]() |
![]() |
![]() |
![]() |
harversters.tif | ![]() |
![]() |
![]() |
![]() |
icon.tif | ![]() |
![]() |
![]() |
![]() |
lady.tif | ![]() |
![]() |
![]() |
![]() |
self_portrait.tif | ![]() |
![]() |
![]() |
![]() |
three_generations.tif | ![]() |
![]() |
![]() |
![]() |
train.tif | ![]() |
![]() |
![]() |
![]() |
turkmen.tif | ![]() |
![]() |
![]() |
![]() |
village.tif | ![]() |
![]() |
![]() |
![]() |
I also added an automatic cropping feature to my code to crop the images. This feature also uses the Sobel filter to do the edge detection. In this function, RGB filtered values are summed and thresholded to find the row and column values for cropping at right, left, top and bottom edges.
File Name | Before | After Cropping |
---|---|---|
emir.tif | ![]() |
![]() |
cathedral.jpg | ![]() |
![]() |
harvesters.tif | ![]() |
![]() |
icon.tif | ![]() |
![]() |
lady.tif | ![]() |
![]() |
self_portrait.tif | ![]() |
![]() |
three_generations.tif | ![]() |
![]() |
train.tif | ![]() |
![]() |
turkmen.tif | ![]() |
![]() |
village.tif | ![]() |
![]() |