1. An image processing device for selecting an image, the image processing device comprising: a storage device configured to store program codes; and a processing unit configured to execute the program codes to operate: a detection part configured to detect a predetermined photographic subject from an image; a photographic subject region identifying part configured to identify a photographic subject region that is a region on the image, the region including the predetermined photographic subject detected by the detection part; a background region identifying part configured to identify a background region that is a region on the image, the region being other than the photographic subject region identified by the photographic subject region identifying part; a sharpness identifying part configured to identify sharpness of the photographic subject region and sharpness of the background region; a score calculation part configured to calculate a score, based on a difference between the sharpness of the photographic subject region and the sharpness of the background region; and a determination part configured to determine the image as an optimum image when the score calculated by the score calculation part is compared with an optimum image threshold and the score indicates that the photographic subject region is clearer than the background region; wherein the score calculation part is configured to calculate the score by multiplying a weighting factor and a difference between the sharpness of the photographic subject region and the sharpness of the background region and the weighting factor is a value that increases as the sharpness of the photographic subject region increases or as the sharpness of the background subject region decreases.