Patent ID: 7813558

Claim:
A template matching method of detecting a position of an image region similar to a template image region from on a reference image, said method comprising the steps of: calculating a similarity of the image region to the template image region at rough position intervals; estimating a similarity at a position, where the similarity is not calculated, making use of directional gradients of similarity obtained independently in a plurality of directions from the calculated values of similarity; determining, based on the calculated values of similarity obtained in the calculating step and the estimated value of similarity obtained in the estimating step, a position having a small calculated or estimated value of the similarity as a position of a similar image region; and restricting a value range of the estimated similarity value such that a difference between the estimated similarity value and the similarity of a periphery used for the estimation or the gradient of the similarity does not exceed a threshold value, wherein the calculating step, estimating step, determining step and restricting step are performed by a processor.