For Fa2024, I am taking an image processing class. One assignment is to Colorizing the Prokudin-Gorskii photo collection.

To do this I split the images into r, g, b color channels and iterated through offsets from -15 to 15 and computed their cross correlations. By picking the highest one, I was able to align most of the images. For the high resolution images, I implemented an image pyramid to increase speed.

I encountered difficulties on the picture of the person sitting in a chair. In order to fix the alignment, I tried out using an edge detector kernel to extract the edges in red, green, and blue. Then align those with maximizing normalized covariance.

This is what the challenging photo looked like after the edge detection was done:

0

and this is after:

0

Offsets are of form (offsetX_g, offsetY_g), (offsetX_r, offsetY_r)

Here are my before and after results for all the images:

Low res Link to heading

0 offset (-3, 2) (3, 2) 0 offset (3, 3) (6, 3) 0 offset (5, 2) (12, 3)

Big Link to heading

offsets are list in image pyramind order (first is multiplied by 16, then 8, then 4, then 1)

Before Link to heading

(3, 1) (7, 2) (0, 3) (-1, 5) (0, 5) (1, 8) (2, 14) (-3, 15) 0 (1, 0) (4, 0) aligning g aligning r (1, 0) (-1, -1) aligning g aligning r (0, 1) (1, -1) aligning g aligning r (1, 3) (-2, -2) 0 (3, 1) (7, 1) (0, 2) (0, 1) (1, 3) (0, 2) (0, 8) (-1, 7) 0 processing ./data/melons.tif aligning g aligning r (5, 1) (11, 1) aligning g aligning r (0, 1) (0, 1) aligning g aligning r (0, 2) (1, 3) aligning g aligning r (1, 6) (-2, 8) 0 (3, 2) (7, 2) aligning g aligning r (0, 3) (0, 4) aligning g aligning r (1, 5) (-1, 8) aligning g aligning r (-1, 15) (1, 15) 0 (3, 0) (6, 2) aligning g aligning r (-1, 1) (-1, 4) aligning g aligning r (1, 1) (0, 6) aligning g aligning r (-2, 3) (-2, 15) 0 (4, 2) (8, 3) aligning g aligning r (-1, 4) (0, 6) aligning g aligning r (0, 6) (0, 10) aligning g aligning r (1, 15) (3, 15) 0 (3, 1) (6, 1) aligning g aligning r (-1, 2) (-1, 3) aligning g aligning r (0, 3) (0, 5) aligning g aligning r (1, 11) (1, 14) 0 (3, 0) (7, 0) aligning g aligning r (0, 0) (-1, -1) aligning g aligning r (1, 1) (0, -1) aligning g aligning r (-1, 2) (1, -4) 0 (2, 2) (15, -2) aligning g aligning r (1, 4) (5, -15) aligning g aligning r (-1, 6) (-2, -5) aligning g aligning r (2, 15) (1, -15) 0 (5, 2) (11, 2) aligning g aligning r (0, 3) (0, 4) aligning g aligning r (0, 6) (0, 8) aligning g aligning r (-3, 15) (-1, 15) 0 (4, 1) (8, 1) aligning g aligning r (-1, 2) (-1, 2) aligning g aligning r (1, 3) (1, 3) aligning g aligning r (-1, 11) (-1, 7) 0 (2, -1) (9, -2) aligning g aligning r (0, -1) (-1, -3) aligning g aligning r (0, -2) (1, -5) aligning g aligning r (1, -7) (-1, -15) 0 (3, 1) (7, 1) aligning g aligning r (0, 1) (0, 1) aligning g aligning r (1, 2) (0, 2) aligning g aligning r (0, 5) (1, 8) 0 (3, 1) (7, 1) aligning g aligning r (0, 1) (0, 1) aligning g aligning r (1, 2) (0, 2) aligning g aligning r (0, 5) (1, 8)

After: Link to heading

0 0 0 0 0 0 0 0 0 0 This one seems to have failed because the images are not nicely in 3rds so the r,g,b slices where not cropped properly… 0 0 0 0

Offsets Link to heading

Here are the offsets I calculated for the images in order:

code