CS 194 Project 1

Author: Anoop Baliga

Overview

We were given a really interesting project where we had to codify the Sergei Mikhailovich Produkin-Gorskii project where he took each photo thrice and covered it with red, green, and blue plates. What we did was take the black and white negatives that Gorskii had taken and used imaging processing technqiues to extract the three color images, put them on top one another, and determine the best combonation of red, green, and blue plates that produced the desired coloring results. This was a really fun project that pushed us and taught us how to color effectively!

Smaller JPG Images

For smaller images jpg, I ran the naive algorithm using the sum of squared differences. I used blue as the base image, and aligned the red and green image based on the blue image. I first cropped off 8% of the image each side to ignore the haziness of the borders and iterated through a window of [-15, 15] displacement in both the x and y direction. I then used the sum of the square difference in my alignment function to minimize the pixel differences and determine how much to shift the green and red images to best align with the blue image. After shifting the green and red images, I then stacked these three images on top of each other to return the optimally colored picture. Please see below for some examples of the work I did! These photos include nativity, settlers, a monastery, and a cathedral.

                            R [2,2] G [0, -4]                                                                           R [0,8] G [0,2]                                                           R [0, 18] G [0,6]

                            R [0, 10] G [0, 2]

Larger Tif Images

For larger images tif, I used the image pyrmaid technique to scale the images down to a manageble size and then ran the SSD algorithm from above when aligning the red and green image. For these images, I first cropped off 8% of the image on either to ignore the hainess of the borders and ran the image pyrmaid scaling process. I then rescale the image in half until it reaches a size where the height or the width is less than 300 pixels. I then run the SSD algorithm in the [-15, 15] displacement in both the x and y direction on these pixels to determine how much to shift these scaled down red and green images. I use these shifts to then determine what to call the alignment function on the larger subsection of the red and green image when when propogating back up. This way I can ensure that the larger images are properly colored! These photos include Emir, harvesters, icon, lady, self_portrait, three_generations, turkmen, village and trains.

                        R [18, 102] G [10, 46]                                                               R [8, 124] G [12, 58]                                                                 R [22, 90] G [16, 40]

                        R [-16, 106] G [-4, 48]                                                               R [-4, 202] G [-2, 76]                                                                 R [8, 112] G [6, 52]

                        R [6, 114] G [6, 54]                                                               R [-14, 136] G [-6, 62]                                                                 R [2, 90] G [-2, 42]

New Images

Below is the algorithm run on new images found from last semester. This includes melons, onion_church and workshop tif images!

                        R [6, 202] G [4, 82]                                                               R [36, 108] G [24, 52]                                                                 R [-14, 104] G [-4, 52]

Challenges and New Images

The challenges with these images where the ones that had multiple color changes and jumps. For example this included both village file and the self-portrait file as there are so many different colors in the photo meaning if the the alingment is even off by a little bit it causes the photo to look blurry or not completely correct.