An object of the present invention is to extract an image closest to a
reference image from among a plurality of candidate images. A plurality
of candidate images similar to the reference image are extracted from a
plurality of images by utilizing granulometry. The plurality of candidate
images is transformed based on the reference image. Mutual information
shared by each of the transformed candidate images and the reference
image is calculated. A candidate image sharing the largest amount of
mutual information with the reference image is selected from among the
plurality of candidate images.