Gorskii's negatives have held up pretty well considering the their age and the technology used to conceive them. However, their imperfections (the slightly blurred edges, handwritten iteration numbers, a recorded movement unique to the third frame) which make them so beautiful to the naked eye, are akin to horrible wrenches thrown into the calculated perfection of a single algorithm designed to work well for all of them. To overcome this, I do a bit of preprocessing before I calculate the alignment of the photographs. First I use the corner() function in Matlab to distinguish between the clean white border (probably a relic of the scanning) and the distressed black outline to each of the exposures. I then crop based on the smallest and largest corner identified. Afterwards I seperate the three channels into distinct images based on the height of the post-cropped photographs, and then do an extremely rough crop on each of these of about 10% to eliminate as much of the black boarder as I can.
Aligning them happens in a similar fashion to how you would approach the problem if you had the negatives laying on a light board in front of you. Stack, shift one a little bit over to the right, see if it looks better, try a little to the left, and repeat until you find the best results. I acheive this using the Sum of Squared Differences (SSD) to calculate the "cost" of each alignment and doing my best to minimize it. Normalized cross-correlation was another option, but produced virtually indistinguishable results from SSD and was a little slower, so I discarded it. This worked beautifully for the smaller images, using a window of about [-15, 15] to search. However, on the larger images it was god awful. Not only was it horrendously slow, but the results were far from anything remotely resembaling even the distant unattractive cousin of a photograph.
To address this new concern I decided to turn to my good friend recursion. Since the algorithm worked so well on the smaller images, you could recursively create a gaussian pyramid, calculate the best alginment, and pass it up to the next largest image to use as the starting point for the bounds of its window and so on. Only after hours of agony did I realize this was a terible idea. Recursion is not your friend. It is confusing, and in this case (since I'm only doing around 4 pyramid calculations), similar to using Mjölnir to crack a walnut. Completely unecessary. In the end, I simply calculated my four reductions, save them as variables and pass the transform through a slightly modified version of my original alignment function (multiplying the result by two each time I resize the image) without much more code than the recursion method. Also, when I align on the larger images, I only look at the center half of the pixels, to even further rid myself of pesky algorithm smashing smudges/borders.