An imaging apparatus comprising: an imaging unit configured to image a subject to generate a captured image; a focal range control unit configured to cause the imaging unit to capture n captured images I(x,y) having mutually different focal ranges, continuously changing a focal position of the imaging unit during exposure of each of the n captured images, where n is an integer greater than or equal to 2; a reference image generation unit configured to generate a reference image R(x,y) to be used as a blur standard, by generating an average image of the n captured images and using the average image; and a distance measurement unit configured to (i) generate a plurality of convolution images by performing a convolution operation on the reference image R(x,y) with a plurality of point spread functions PSFs h(x, y, d) corresponding to a plurality of subject distances d= d1, ···, dn, (ii) for each of the n captured images, determine, from among the plurality of convolution images, a convolution image having a smallest difference from the respective captured image I(x,y) at a position (x, y), (iii) for each of the n captured images, measure, as a subject distance at the position (x,y) from the imaging apparatus to the subject, a distance corresponding to a point spread function PSF h(x, y, d) which has been used in the convolution operation on the convolution image and provides said smallest difference, thereby creating a distance map d(x,y) for each of the n captured images, and (iv) calculate a merged distance map by merging the n distance maps, wherein the focal ranges of the n captured images are independent of each other, and an out-of-focus space is provided between the focal ranges. an imaging unit configured to image a subject to generate a captured image; a focal range control unit configured to cause the imaging unit to capture n captured images I(x,y) having mutually different focal ranges, continuously changing a focal position of the imaging unit during exposure of each of the n captured images, where n is an integer greater than or equal to 2; a reference image generation unit configured to generate a reference image R(x,y) to be used as a blur standard, by generating an average image of the n captured images and using the average image; and a distance measurement unit configured to (i) generate a plurality of convolution images by performing a convolution operation on the reference image R(x,y) with a plurality of point spread functions PSFs h(x, y, d) corresponding to a plurality of subject distances d= d1, ···, dn, (ii) for each of the n captured images, determine, from among the plurality of convolution images, a convolution image having a smallest difference from the respective captured image I(x,y) at a position (x, y), (iii) for each of the n captured images, measure, as a subject distance at the position (x,y) from the imaging apparatus to the subject, a distance corresponding to a point spread function PSF h(x, y, d) which has been used in the convolution operation on the convolution image and provides said smallest difference, thereby creating a distance map d(x,y) for each of the n captured images, and (iv) calculate a merged distance map by merging the n distance maps, wherein the focal ranges of the n captured images are independent of each other, and an out-of-focus space is provided between the focal ranges. <EOS>