This project aims to develop an algorithm to colorize images from the digitized Prokudin-Gorskii glass plate photo collection. Prokudin-Gorskii traveled across the Russian Empire to take color photographs: he recorded three exposures of every scene onto a glass plate, filtered by red, green, and blue, respectively. The goal of this project is to take these three exposures (also known as the R, G, and B channels), detect image similarity, and match and align the three channels to create a color image.
* Photography technique details can be found here.
* Project description details can be found here.
Original Image | Unaligned | Aligned | Displacement |
---|---|---|---|
cathedral.jpg g_displacement(x, y): (2, 5) r_displacement(x, y): (3, 12) |
|||
monastery.jpg g_displacement(x, y): (2, -3) r_displacement(x, y): (2, 3) |
|||
tobolsk.jpg g_displacement(x, y): (3, 3) r_displacement(x, y): (3, 7) |
For higher resolution images, the naive solution of exhaustive search becomes expensive to process a single image. So I implemented an image pyramid to improve the algorithm.
Unaligned | Aligned | Displacement |
---|---|---|
church.tif g_displacement(x, y): (4, 25) r_displacement(x, y): (-4, 58) Time Spent (sec): 48.11599898338318 |
||
emir.tif g_displacement(x, y): (24, 48) r_displacement(x, y): (-197, 235) Time Spent (sec): 59.1813850402832 Here is a problem! Please see the next section for the solution. |
||
harvesters.tif g_displacement(x, y): (17, 59) r_displacement(x, y): (15, 123) Time Spent (sec): 35.33838629722595 |
||
icon.tif g_displacement(x, y): (17, 41) r_displacement(x, y): (23, 90) Time Spent (sec): 35.365917682647705 |
||
lady.tif g_displacement(x, y): (8, 51) r_displacement(x, y): (11, 111) Time Spent (sec): 40.0497772693634 |
||
melons.tif g_displacement(x, y): (9, 81) r_displacement(x, y): (13, 179) Time Spent (sec): 39.810834646224976 |
||
onion_church.tif g_displacement(x, y): (27, 50) r_displacement(x, y): (37, 108) Time Spent (sec): 40.9604709148407 |
||
self_portrait.tif g_displacement(x, y): (29, 78) r_displacement(x, y): (37, 175) Time Spent (sec): 45.00173234939575 |
||
three_generations.tif g_displacement(x, y): (15, 50) r_displacement(x, y): (13, 110) Time Spent (sec): 37.09463381767273 |
||
train.tif g_displacement(x, y): (6, 41) r_displacement(x, y): (33, 85) Time Spent (sec): 36.39931297302246 |
||
workshop.tif g_displacement(x, y): (-1, 53) r_displacement(x, y): (-12, 105) Time Spent (sec): 35.91730284690857 |
In the Emir of Bukhara case, the three channels of images do not have the same brightness values, and thus causes errors in the image similarity calculation process. By doing edge detection before comparing image similarity, this problem can be solved. The detector I used is the Canny edge detector from scikit-image.
Original Image | Edge Detection |
---|---|
Result of the Previous Method | Improved Result | Displacement |
---|---|---|
emir.tif g_displacement(x, y): (23, 49) r_displacement(x, y): (40, 107) Time Spent (sec): 36.40872311592102 |
Unaligned | Aligned | Displacement |
---|---|---|
in_little_russia.jpg g_displacement(x, y): (0, 2) r_displacement(x, y): (0, 12) |
||
reserve_girders.jpg g_displacement(x, y): (2, 1) r_displacement(x, y): (3, 4) |
||
wall_paintings.jpg g_displacement(x, y): (1, -3) r_displacement(x, y): (3, -1) |
||
cloth.tif g_displacement(x, y): (52, 57) r_displacement(x, y): (81, 112) Time Spent (sec): 35.477495431900024 |