This homework is related to aligning separate channels of an image to create a final color image. We use images from the Prokudin-Gorskii Collection which were captured using different colored glass plates between 1905 and 1915. All images from the original negatives have been digitized by the US Library of Congress and are available here.
We use an approach that involves a metric to quantify the quality of the match, searching across different displacements to calculate offsets and then finally using these offsets to create a final RGB image.
The metric we use to quantify the quality of the match is Normalized Cross Correlation. Ideally we would probably do the NCC calculation on the full image, but this would create a lot of computations, especially when the maximum image resolutions are in the 1000s. Also the search space can also quickly get really large, which would make the whole process really slow.
We carry our certain optimizations to ensure the alignment process happens efficiently and gives results really fast.
The optimizations I implemented include
cathedralOffsets: R (0,0), G (-1,-7), B (-3,-12)
emirOffsets: R (0,0), G (-17,-57), B (-57,-103)
harvestersOffsets: R (0,0), G (3,-65), B (-13,-124)
iconOffsets: R (0,0), G (-5,-48), B (-23,-90)
ladyOffsets: R (0,0), G (-3,-62), B (-11,-116)
self_portraitOffsets: R (0,0), G (-8,-98), B (-36,-176)
three_generationsOffsets: R (0,0), G (3,-58), B (-11,-112)
trainOffsets: R (0,0), G (-27,-43), B (-32,-87)
turkmenOffsets: R (0,0), G (-7,-60), B (-28,-116)
villageOffsets: R (0,0), G (-10,-73), B (-22,-138)
1 original image Offsets: R (0,0), G (3,-82), B (5,-114)
2 original image Offsets: R (0,0), G (-22,-71), B (-49,-138)
3 original image Offsets: R (0,0), G (4,-60), B (2,-107)
4 original image Offsets: R (0,0), G (-2,-77), B (-28,-140)
5 original image Offsets: R (0,0), G (-12,-73), B (-30,-92)
Default styles courtesy stackedit.io