1. A method of determining whether a first image matches a second image, comprising: extracting from said first and second images respective first and second templates, each template comprising a spatial arrangement of template codes; overlaying on said first template a master mask comprising a spatial arrangement of master mask codes, each master mask code being representative of an expected variability or matching reliability within a population of images of a template code of corresponding spatial location; comparing said overlaid first template with said second template; and determining whether a match exists in dependence upon said comparison.