1. A template-matching apparatus, comprising: a first calculating unit calculating, for image information of a template image including a plurality of color components, a first characteristic amount from the image information of the template image including at least one of colors among the plurality of color components; an extracting unit extracting a partial image for computation use from a plurality of different positions in an input image including the plurality of color components; a second calculating unit calculating, for image information of the partial image extracted by the extracting unit, a second characteristic amount from the image information of the partial image including at least one of colors among the plurality of color components; a third calculating unit calculating a residual amount from the image information of the template image and the image information of the partial image; a first computing unit finding a first degree of similarity between the template image and the partial image by comparing the first characteristic amount and the second characteristic amount; a second computing unit finding a second degree of similarity based on the residual amount; a third computing unit finding a third degree of similarity based on the first degree of similarity and the second degree of similarity according to a relationship R=w×r s +(1−w)×r T , where w is a weight having a value from 0 to 1, r s is the second degree of similarity and r T. is the first degree of similarity; and a specifying unit specifying a matching position with the template image in the input image by comparing the third degree of similarity found at each of positions in the input image.