Implements grid matching of a template grid to an observed image