194 Project 1: Images of the Russian Empire

Small Picture Approach

For the small pictures I perfomed a basic alignment of the color layers based on the SSD scores (l2). I tested alignment values for both x and y axis in a range from -15 to 15 pixels and chose the alignment that minimized this score. To remove noise from the edges that occured when the picture rolled over (and general noise from the edges) I cropped any images by 15 on all sides before comparison. This greatly improved the color matching.

Example of score search for catherdral:

Italian Trulli

Italian Trulli Italian Trulli Italian Trulli

Alignments - (R: [x y] means I moved the red image right x pixels and down y pixels)


monastery: G: [2 -3] R: [2 3]
cathedral: G: [2 5] R: [1 9]
tobolsk: G: [2 3] R: [3 6]

Big Picture Approach

For the big pictures I was unable to do a simple loop as it would take too long on such a large image. Instead I used an image pyramid of 4 layers to obtain my final output. I scaled the image down by 8 to begin with which allowed for faster search. Then on each layer I doubled my image axis and halfed the search radius around the area suggested by my previous layer. This allowed me to faster lock in the correct match. I once again trimmed the photo based on the search width to avoid noise from the rollover.


Required Photos:


Italian Trulli Italian Trulli Italian Trulli Italian Trulli Italian Trulli Italian Trulli Italian Trulli Italian Trulli Italian Trulli Italian Trulli Italian Trulli

Alignments - (R: [x y] means I moved the red image right x pixels and down y pixels)


castle G: [ -7 25 ] R: [ -7 89 ]
emir G: [ 5 21 ] R: [ -1 63 ]
harvesters G: [ -3 49 ] R: [ 9 105 ]
icon G: [ 9 33 ] R: [ 17 81 ]
lady G: [ -11 49 ] R: [ -17 105 ]
melons G: [ 1 73 ] R: [ -23 105 ]
onion_church G: [ -3 41 ] R: [ 25 105 ]
self_portrait G: [ -7 73 ] R: [ -15 105 ]
three_generations G: [ 1 49 ] R: [ 1 105 ]
train G: [ -7 33 ] R: [ 15 81 ]
workshop G: [ -7 49 ] R: [ -23 97 ]

Extra Photos:


Italian Trulli Italian Trulli Italian Trulli

Alignments - (R: [x y] means I moved the red image right x pixels and down y pixels)


bridge G: [ -7 9 ] R: [ -15 9 ]
house G: [ 1 41 ] R: [ -7 89 ]
mansion G: [ 1 81 ] R: [ -13 103 ]

Switching the base color (Bells and Whistles)

One thing I tried playing around with was if I used a different filter as the "base" instead of blue (as in the started code). I tested this on emir as this was my worst performer. Suprisingly using green as the base greatly improved the visual quality of this image. After this I moved on to applying this to different images to see how it would affect quality. Here are some of the best examples (as I could not fit all photos under 25mb)

                           Left: Blue fixed                                                  Right: Green fixed

Italian Trulli Italian Trulli
Italian Trulli Italian Trulli
Italian Trulli Italian Trulli

Italian Trulli Italian Trulli

Italian Trulli Italian Trulli

Italian Trulli Italian Trulli

Alignments - (R: [x y] means I moved the red image right x pixels and down y pixels)


castle B: [ -7 -39 ] R: [ -7 57 ]
emir B: [ -31 -55 ] R: [ 9 49 ]
harvesters B: [ -23 -71 ] R: [ -7 57 ]
icon B: [ -23 -47 ] R: [ 1 41 ]
lady B: [ -7 -63 ] R: [ -11 57 ]
melons B: [ -15 -95 ] R: [ -7 89 ]
onion_church B: [ -31 -63 ] R: [ 1 49 ]
self_portrait B: [ -7 -81 ] R: [ -1 89 ]
three_generations B: [ -23 -63 ] R: [ -7 49 ]
train B: [ -7 -55 ] R: [ 1 33 ]
workshop B: [ -7 -63 ] R: [ -15 41 ]
bridge B: [ -15 -23 ] R: [ -7 -7 ]
house B: [ -15 -55 ] R: [ -15 49 ]
mansion B: [ -23 -87 ] R: [ -7 89 ]