1. An image processing method implemented in an imaging device that includes a microlens array including a plurality of microlenses, a main lens configured to guide light from a photographic subject to the microlens array, and an image sensor configured to receive the light after passing through the main lens and the microlens array, the method comprising: obtaining an image captured by the image sensor; setting, according to an image height, an arrangement of a microlens image of interest and a plurality of comparison-target microlens images from among microlens images that are included in the image and that are formed by the microlenses; detecting an amount of image shift between the microlens image of interest and each of the comparison-target microlens images by comparing the microlens image of interest with the comparison-target microlens images; and calculating a distance corresponding to the microlens image of interest using the amounts of image shift.