In general this Project aimed to be able to reconstruct the images made by Sergei Mikhailovich Prokudin-Gorskii and take them from their grayscale originals to their colorized versions. The difficulty here was to align the images appropriately to recreate the colorized images.
The general approach to this problem is to start with small images and design a basic algorithm that checks the 15 pixels to the left right up and down. Essentially you are checking 900 different translations. This does not work however for some of the much larger images where those 900 translations did not contain the optimal alignment. For such images, the way to find the optimal alignment is to first decrease the image sizes by some factor and search for the optimal alignment. After achieving the best alignment in the rougher image, you can scale the images back up and and then use a more localized search to get the optimal alignment.
These two methods work fairly well, however to make them even better, I have added some border cutting.The goal of instantly removing 10% of the image from all sides is to not deal with getting alignment errors from the differing borders. On top of all of this, I added two bells and whistles to potentially make some of the images look slightly better. First I tried to align just the sobel filters of the images to produce extra sharpness of the images. Next I also implemented some Automatic White Balancing to remove some of the excess illuminants.
Blue Alignment (-4, -2) Red Alignment (6, 0) |
Blue Alignment (-4, -2) Red Alignment (4, 0) |
Blue Alignment (-2, -2) Red Alignment (4, 0) |
Blue Alignment (4, -2) Red Alignment (6, 0) |
Blue Alignment (-6, 0) Red Alignment (8, 0) |
Blue Alignment (-50, -24) Red Alignment (56, 18) |
Blue Alignment (-60, -16) Red Alignment (64, -2) |
Blue Alignment (-42, -16) Red Alignment (48, 6) |
Blue Alignment (-56, -8) Red Alignment (62, 4) |
Blue Alignment (-78, -28) Red Alignment (98, 8) |
Blue Alignment (-54, -14) Red Alignment (58, -2) |
Blue Alignment (-42, -6) Red Alignment (44, 26) |
Blue Alignment (-56, -20) Red Alignment (60, 8) |
Blue Alignment (-64, -12) Red Alignment (72, 10) |
Blue Alignment (-52, 22) Red Alignment (56, -34) |
Blue Alignment (-52, 0) Red Alignment (52, -10) |
Blue Alignment (-92, 26) Red Alignment (100, -26) |
Before:
|
After:
|
Before:
|
After:
|
Before:
|
After:
|
The next part of my bells and whistles was to implement an auto contrast function. The best way to autocontrast was to take the darkest pixel from each channel and set it 0 and then take scale the remaining pixels so that the brightest pixel has a value 1. Below are some of the results of this algorithm working after I do the greyworld algorithm.
Before:
|
After:
|
Before:
|
After:
|
Before:
|
After:
|
Before:
|
After:
|