1. An image processing apparatus comprising: an acquisition unit that acquires partial features of an input pattern and partial features of each of registered patterns; a composition unit that generates composited partial features of the input pattern by combining a plurality of the partial features of the input pattern, and that generates, for each of the registered patterns, composited partial features of the registered pattern by combining a plurality of partial features of the registered pattern corresponding to the partial features in the composited partial features of the input pattern; a similarity calculation unit that calculates, for each of the registered patterns, a similarity between each partial feature in the composited partial features of the input pattern and a corresponding partial feature in the composited partial features of the registered pattern; a counting unit that counts, for each of the registered patterns, a number of partial features included in the composited partial features of the registered pattern for which the calculated similarity is higher than a threshold; a variance calculation unit that calculates a variance for the composited partial features of the input pattern based on a variance of spatial positions and/or spatial sizes of the partial features in the input pattern; an evaluation unit that evaluates each of the registered patterns based on the variance for the composited partial features of the input pattern and the counted number of partial features for which the similarity is higher than the threshold; and an identification unit that identifies, among classes to which respective registered patterns belong, a class corresponding to the input pattern based on an evaluation result from said evaluation unit, wherein the variance of spatial positions is a function of a difference between the spatial position of a partial feature and an average spatial position, and the variance of spatial sizes is a function of a difference between the spatial size of a partial feature and an average spatial size, and wherein said acquisition unit, said composition unit, said similarity calculation unit, said counting unit, said variance calculation unit, said evaluation unit, and said identification unit are implemented using a processor and memory.