cathedral.jpg
Red displacement is (3, 12), Green displacement is (2, 5)
This picture took 0.31 seconds to run.
The purpose of the project was to take images collected from the Prokudin-Gorskii Image dataset from the US Library of Congress and combine the manually channeled photos into one color image.
The jpeg files were incredibly small and could be iterated upon by a modern machine very quickly. I started by using the Sum of Squared Differences on a [-15, 15] cross section of the image. The way this cross section was generated was by conducting a two dimsneional rolling off the pixels by 15 pixels up, down, left, and right each. After calculating the SSD of each rolled combination, we selected the minimum displacement and stored this as the alignment adjustment.
One important consideration is that this method was only effective with small images where the -15x15 displacement provided ample diversity in image features. In a much higher resolution image, a 15 pixel cross section could very easily be replicated in many places (e.g. one part of the sky with another part of the sky). More importantly, rolling large numbers of pixels takes significantly longer. Running the native alignment on larger images (.tif) took over 100 seconds for each alignment and the alignment itself was rather poor. (Samples shown in the content below). Therefore, for larger images, we use the pyramid method of constructing slightly smaller images and gathering a rough estimate of alignment and using this inference to speed up the final alignment. The pyramid method downscales until the image reaches a manageable size of 500 pixels.
I used roberts edge detection algorithm from the skimage filters library to improve the alignment. The edge detected images have a much higher contrast and help align by edges as opposed to the rgb alignment. Furthermore, to write the html for this page, I wrote a function that takes in the parameters of time and displacement and automatically generated the body to save time.
Red displacement is (3, 12), Green displacement is (2, 5)
This picture took 0.31 seconds to run.
Red displacement is (41, 106), Green displacement is (23, 48)
This picture took 3.34 seconds to run.
Red displacement is (18, 123), Green displacement is (19, 59)
This picture took 3.28 seconds to run.
Red displacement is (24, 89), Green displacement is (18, 40)
This picture took 3.38 seconds to run.
Red displacement is (11, 105), Green displacement is (7, 48)
This picture took 3.30 seconds to run.
Red displacement is (2, 3), Green displacement is (2, -3)
This picture took 0.36 seconds to run.
Red displacement is (0, 7), Green displacement is (1, 3)
This picture took 0.32 seconds to run.
Red displacement is (37, 175), Green displacement is (29, 77)
This picture took 3.42 seconds to run.
Red displacement is (-1, 14), Green displacement is (0, 7)
This picture took 0.33 seconds to run.
Red displacement is (12, 108), Green displacement is (15, 49)
This picture took 3.38 seconds to run.
Red displacement is (32, 85), Green displacement is (6, 42)
This picture took 3.32 seconds to run.
Red displacement is (29, 117), Green displacement is (22, 56)
This picture took 3.30 seconds to run.
Red displacement is (23, 136), Green displacement is (13, 64)
This picture took 3.44 seconds to run.
Red displacement is (-37, 74), Green displacement is (-18, 24)
This picture took 3.31 seconds to run.
Red displacement is (-4, 57), Green displacement is (4, 24)
This picture took 3.22 seconds to run.
Red displacement is (101, 82), Green displacement is (51, 31)
This picture took 3.29 seconds to run.
Red displacement is (-34, 118), Green displacement is (-16, 49)
This picture took 3.45 seconds to run.
Red displacement is (83, 113), Green displacement is (43, 35)
This picture took 3.26 seconds to run.
Red displacement is (-35, 101), Green displacement is (-19, 41)
This picture took 3.37 seconds to run.
Red displacement is (25, 174), Green displacement is (21, 82)
This picture took 3.35 seconds to run.
Red displacement is (50, 74), Green displacement is (23, 48)
This picture took 3.04 seconds to run.
Red displacement is (82, 113), Green displacement is (42, 36)
This picture took 2.96 seconds to run.
Red displacement is (23, 136), Green displacement is (12, 64)
This picture took 3.14 seconds to run.
This picture took 101.57 seconds to run.
This picture took 102.41 seconds to run.