Prokudin-Gorskii glass plate images are captured using red, green, blue filter. By aligning correctly and stack red, green, blue filted pictures together, we can created a colored picture from black and white picture. The procedure includes dividing the images into three equal parts, finding the best alignment using SSD, and stacking them onto one another.
First divide the picture into three equal parts. These divided images will be refered to as b, g, r. For the single scale version, we simply calculate the best alignments for g and b, and r and b using SSD, then adjust g and r, then stack the adjusted b, g, r onto one another. Pyramid algorithm includes rescaling b, g, r into lower resolution, find the best alignments for rescaled g and b, then using these best-aligned X and Y, create smaller window of search for higher resolution.
For pyramid recursion, it took me a multiple tries to find best starting rescaling value and its corresponding windows. I had to tweak some values to find them
vector for adjusted G: (-1, 1), adjusted R: (-1, 7)
vector for adjusted G: (1, 3), adjusted R: (1, 7)
vector for adjusted G: (0, -6), adjusted R: (1, 9)
vector for adjusted G: (0, 7), adjusted R: (-1, 14)
vector for adjusted G: (7, -3), adjusted R: (17, 95)
vector for adjusted G: (10, 59), adjusted R: (-1, 95)
vector for adjusted G: (16, 42), adjusted R: (22, 89)
vector for adjusted G: (-6, 57), adjusted R: (-17, 95)
vector for adjusted G: (-2, 50), adjusted R: (-5, 95)
vector for adjusted G: (5, 52), adjusted R: (5, 95)
vector for adjusted G: (-2, 41), adjusted R: (2, 95)
vector for adjusted G: (4, 57), adjusted R: (0, 80)
vector for adjusted G: (-7, 18), adjusted R: (-15, 95)
vector for adjusted G: (-1, 12), adjusted R: (-2, 10)
vector for adjusted G: (-1, 7), adjusted R: (-1, 9)
vector for adjusted G: (-1, 5), adjusted R: (-3, 12)
Some images are obviously aligned incorrectly. That is due to b, g, r images having different brightness which causes inaccurate "best score" for SSD.