A storage medium storing computer readable program code for performing, when executed, an image retrieval method for retrieving, from an image database, image data including an image similar to a designated image, the code comprising:
- code for detecting, in accordance with each of a plurality of regions in a first image in the database and the designated image, which of the plurality of regions are included in the designated image, each of the plurality of regions so detected being identified as a detected region;
- code for obtaining a compound region of the first image as a combination of the detected regions;
- code for calculating a similarity between the compound region and the designated image;
- and
- code for searching for the image data including the image similar to the designated image in accordance with the calculated similarity.