CS 194-26: Project 1

Vinay Chadalavada

Overview

This project revolves around coloring pictures that were taken by Prokudin-Gorskii. He had the foresight to take photos with 3 different filters, thus allowing him to capture red, blue, and green pixel values. To color these photos we have properly stack the 3 different filters on top of each other to get RGB pixel values. We also might have to slightly move the filters around to get a better alignment (for most images in this project I aligned the red and green filter to the blue filter). The metric I used to find the best alignment was Sum of Square Differences: sum((img1 -img2) ^ 2). The shift which produced the smallest number was used as the optimal alignment and when computing the metric I used only the internal pixels as the borders skewed the alignment in some cases. However, this exhaustive search was to computationally expensive for the tif images. To solve the issue, we can create an image pyramid. Each layer is essentially a scaled-down version of the image. My image pyramid shrunk the image by half at each layer and the smallest layer was 1/32 of the original. The idea is we search a large range of alignments at the smallest layer since it is not as intensive and start slighly tuning it as we increase the scale back to normal.

One problem I encountered during the project was aligning emir.tif. When I used the blue filter as the base, the red filter would not properly align as the pixel values of the clothes were much darker in the red filter than in the blue filter. This is because his clothes were blue so most of the red is being absorbed, but almost all the blue is being reflected. To solve this issue I experimented with changing the base filter and found that green worked much better. When displaying the image I also cropped the outer 10%, so the borders won't be displayed.

Colored Output Images

Base Filter: Blue

Red Filter Y Alignment: 12

Red Filter X Alignment: 3

Green Filter Y Alignment: 5

Green Filter X Alignment: 2

Base Filter: Blue

Red Filter Y Alignment: 58

Red Filter X Alignment: -4

Green Filter Y Alignment: 25

Green Filter X Alignment: 4

Base Filter: Blue

Red Filter Y Alignment: 108

Red Filter X Alignment: 36

Green Filter Y Alignment: 51

Green Filter X Alignment: 26

Base Filter: Blue

Red Filter Y Alignment: 3

Red Filter X Alignment: 2

Green Filter Y Alignment: -3

Green Filter X Alignment: 2

Base Filter: Blue

Red Filter Y Alignment: 6

Red Filter X Alignment: 3

Green Filter Y Alignment: 3

Green Filter X Alignment: 3

Base Filter: Blue

Red Filter Y Alignment: 124

Red Filter X Alignment: 13

Green Filter Y Alignment: 59

Green Filter X Alignment: 16

Base Filter: Blue

Red Filter Y Alignment: 112

Red Filter X Alignment: 11

Green Filter Y Alignment: 53

Green Filter X Alignment: 14

Base Filter: Blue

Red Filter Y Alignment: 87

Red Filter X Alignment: 32

Green Filter Y Alignment: 42

Green Filter X Alignment: 5

Base Filter: Blue

Red Filter Y Alignment: 105

Red Filter X Alignment: -12

Green Filter Y Alignment: 53

Green Filter X Alignment: 0

Base Filter: Blue

Red Filter Y Alignment: 178

Red Filter X Alignment: 13

Green Filter Y Alignment: 81

Green Filter X Alignment: 10

Base Filter: Blue

Red Filter Y Alignment: 89

Red Filter X Alignment: 23

Green Filter Y Alignment: 41

Green Filter X Alignment: 17

Base Filter: Blue

Red Filter Y Alignment: 112

Red Filter X Alignment: 11

Green Filter Y Alignment: 51

Green Filter X Alignment: 9

Base Filter: Blue

Red Filter Y Alignment: 176

Red Filter X Alignment: 37

Green Filter Y Alignment: 78

Green Filter X Alignment: 29

Base Filter: Green

Red Filter Y Alignment: 57

Red Filter X Alignment: 17

Blue Filter Y Alignment: -49

Blue Filter X Alignment: -24

Other Selected Photos

Base Filter: Green

Red Filter Y Alignment: 57

Red Filter X Alignment: 17

Blue Filter Y Alignment: -49

Blue Filter X Alignment: -24

Base Filter: Green

Red Filter Y Alignment: 57

Red Filter X Alignment: 17

Blue Filter Y Alignment: -49

Blue Filter X Alignment: -24

Base Filter: Green

Red Filter Y Alignment: 57

Red Filter X Alignment: 17

Blue Filter Y Alignment: -49

Blue Filter X Alignment: -24