%  Take in an image matrix, and pad it with a border of white 16
%  wide, to ensure all footprints are found.  This is done to
%  eliminate problems with indexing outside the image matrices.
function [img] = Pad(img)
  [ir, ic] = size(img);
  img = [.5.*ones(ir, 16), img, .5.*ones(ir, 16)];
  img = [.5.*ones(16, ic+32); img; .5.*ones(16, ic+32)];