1. A method of extracting a feature of an input image, the method comprising: constructing a example pyramid including at least one hierarchical level based on stored example images; generating a codebook in each of the at least one hierarchical level; calculating a similarity between the codebook and the input image; and extracting a feature of the input image based on the similarity.