computer apparatus and method in a computer system provides shape matching . a template of a desired shape is matched to a subset of points in a subject image . the matching is determined according to an arbitrarily complex function of image point values and template point values followed by an arbitrary operation on the plurality of results of the arbitrarily complex function . in the case of fuzzy template matching , the operation is the average preferably followed by clipping to the range for defining fuzzy membership values . the arbitrarily complex function may be formed of a discrete array of single variable functions or single variable lookup tables .