Small module that illustrates how to match patches in an image. The technique computes the mean squared error (MSE) between a "template" patch and the image itself, as follows: MSE(patch, image[j]) = 1/B^2 sum_i((patch[i] - image[i+j]).^2) = 1/B^2 sum_i(patch[i].^2) + 1/B^2 sum_i(image[i+j].^2) • 2/B^2 sum_i(patch[i] .* image[i+j]) Here, the first term is a constant; the second term is computed using an integral image representation. Finally, the third term is obtained using the Discrete Fourier transform (correlation method)