#include "sadie.h"
#include "proto.h"
#include <math.h>
#include <sys/time.h>
Given a pair of images that are known to overlap, we want to register them exactly, so that within the overlapping area each pixel in one image represents the same physical location as a pixel in the other. We handle only the simplest case, where the two images already have identical spatial scales, are undistorted relative to some common coordinate plane, and are not rotated relative to each other. There's even some a priori information about the the relative displacement of one image relative to the other, so we simply search all possible relative positions in the neighborhood of this initial suggestion and accept the one that yields the best value of some goodness-of-fit function.