1. An image processing apparatus comprising at least one processor which implements: a receiver that receives an image; an extractor that extracts, according to a determination of non-edge regions, regions from the image received by the receiver; a selector that selects, in accordance with a predetermined rule, a region from among the regions extracted by the extractor; a measurer that measures luminance values of pixels contained in the region selected by the selector; an estimator that estimates, based on the luminance values of the pixels measured by the measurer, a function representing a degree of fog in the image received by the receiver; and an eliminator that eliminates, on the basis of the function estimated by the estimator, fog from the image received by the receiver, wherein the extractor extracts regions which are equal to or greater than a predetermined size or regions which are greater than the predetermined size, and in response to such regions not being found, processing using the selector, processing using the measurer, processing using the estimator, and processing using the eliminator are not performed.