Project 1

Project 1: Images of the Russian Empire:

Colorizing the Prokudin-Gorskii photo collection

Yuqin Jiao




Overview

Before the align approaches, I first read the image and normalized them with converting to double. Then I cut the input image into 3 channels(b/g/r) using the height of each channel. I also implemented three crop functions(crop_scale, crop_to_even_pixel, crop_match) to crop the image margin/ ensure the image have even number of pixels/ make sure the 3 channels have the same sizes.


Naive Approach

For the naive approach, I used L2 norm to compute the difference between two images, evaluated it as score, and used for loops to find the smallest score, which is the best displacement. Naive approach is ok for the jpg images, but not good for the tif images, because the tif images are really large.

Description of cathedral
Displacement: G (-1, 1); R (-1, 7)
Description of tobolsk
Displacement: G (2, 3); R (3, 6)
Description of monastery
Displacement: G (0, -6); R (1, 9)

Image Pyramid

To implement image pyramid, I used skimage.transform.rescale to first shrink the resolution of image channel, then if the rescaled channel is over 300x300 resolution, I use recursive to process on a smaller image resolution, after the recursive, I upscale the image to original resolution, also double the displacemment( for finding the smallest score and the best displacement, I used the same L2 norm to calculate as naive approach with np.roll to shift the channel). Aftering align the images, I used 0.85 scale crop to cut each channel's margin off to make the output image looks better.
Other image displacement:
melons: G (2, 30) R (-8, -34)
sculpture: G (4, -64) R (52, 86)
self_portrait: G (-14, 82) R (22, -94)
train: G (-6, -88) R (0, 0)

Description of cathedral
Output of Naive Approach
Description of tobolsk
Using Pyramid: G (12, -28) R (8, 30)
Description of cathedral
Output of Naive Approach
Description of tobolsk
Using Pyramid: G (2, -22) R (10, 30)
Description of cathedral
Output of Naive Approach
Description of tobolsk
Using Pyramid: G (-2, -14) R (8, 30)
Description of cathedral
Output of Naive Approach
Description of tobolsk
Using Pyramid: G (-26, -20) R (10, 30)
Description of cathedral
Output of Naive Approach
Description of tobolsk
Using Pyramid: G (12, -6) R (22, -22)
Description of cathedral
Output of Naive Approach

This image downloaded from "Prokudin-Gorskii collection"

Description of tobolsk
Using Pyramid: G (-10, -14) R (-6, 30)
Description of cathedral
Output of Naive Approach

This image downloaded from "Prokudin-Gorskii collection"

Description of tobolsk
Using Pyramid: G (4, -44) R (4, -20)
Description of cathedral
Output of Naive Approach

For the "emir" image, I also used SSIM from skimage.metrics to make the alignment look better. The SSIM score is computed as the higher the better.

Description of tobolsk
Using Pyramid: G (-10, 0) R (6, -16)

The issue in my alignment is after rescaling several times, the images go blurry, although the alignment is ok. I tried to make anti-aliasing = True or False, but the result is similiar. Since the instruction on ed says "anti-alias will blur the image before downsizing and we'll learn about this in lecture this coming week", I think it is ok for now, but I'll try to fix the blur issue after I learn more.


Bells & Whistles

I found an image from pinterest website, and I used photoshop to make it into 3 RGB channels, after that, I put the image as input, and used the same image pyramid function as described above to align the channels, and then got the output image.

Description of cathedral
Input Image
Description of tobolsk
Using Pyramid: G (-2, 0) R (-2, -2)