CS194-26 FA21 Project 1: Colorizing the Prokudin-Gorskii photo collection

By Austin Patel

Overview

The goal of this project is to reconstruct colored images given black and white images taken with red, green, and blue filters. The images can be easily overlapped with one exactly on top of another, but the challenge is that this typically produces images where each channel is slightly offset. To correct this, I tried shifting each image channel within a certain x/y range to find the most aligned section. Similarity of alignment was achieved using normalized dot product. This approach works well for small images, but runs slowly on large images as the number of pixels scales up. To address this, an image pyramid approach was used which recursively applies the original alignment method to images that have been reduced in size. The idea is that we can get a rough idea of where the alignment should be from a lower resolution image and then do fine tuning at the highest resolution version.

My approach

Bells and Whistles

Results

File Aligned: Before Border Crop Aligned: After Border Crop Offsets & Run Notes Extra Notes

onion_church

g: (27, 51)

r: (36, 108)

process time (seconds): 35.407472133636475

icon

g: (17, 41)

r: (23, 89)

process time (seconds): 37.71184492111206

train

g: (6, 43)

r: (32, 87)

process time (seconds): 36.435320138931274

melons

g: (11, 82)

r: (13, 178)

process time (seconds): 35.711519956588745

monastery

g: (2, -3)

r: (2, 3)

process time (seconds): 0.4854283332824707

landscape

g: (-2, 42)

r: (9, 97)

process time (seconds): 36.93493580818176

Additional image pulled from collection

flowers

g: (21, 75)

r: (30, 156)

process time (seconds): 36.06981706619263

Additional image pulled from collection

shell

g: (5, 25)

r: (7, 111)

process time (seconds): 36.273571729660034

Additional image pulled from collection

three_generations

g: (14, 53)

r: (11, 112)

process time (seconds): 35.569983959198

church

g: (4, 25)

r: (-4, 58)

process time (seconds): 34.13655710220337

workshop

g: (0, 53)

r: (-12, 105)

process time (seconds): 35.514161109924316

tobolsk

g: (3, 3)

r: (3, 6)

process time (seconds): 0.55177903175354

emir

g: (24, 49)

r: (-209, 269)

process time (seconds): 35.1381938457489

This one did not align well with my process algorithm. I believe this happened because the three different color channels in the original image varied greatly in overall brightness. Because of this, even if channels were properly aligned, there would still be a large difference between the images. The red channel offset that was converged on must have had a larger dot product with the blue channel (the reference channel) at this strange offset compared to the aligned location. Note: order of brightness from low to high was blue, green, then red

lady

g: (8, 55)

r: (11, 117)

process time (seconds): 37.02691984176636

cathedral

g: (2, 5)

r: (3, 12)

process time (seconds): 0.49702978134155273

harvesters

g: (17, 60)

r: (13, 124)

process time (seconds): 34.55814719200134

self_portrait

g: (29, 79)

r: (37, 176)

process time (seconds): 35.488484144210815