1. An image processing apparatus comprising: a receiving device that receives an image; an extracting device that extracts regions from the image received by the receiving device; a selecting device that selects a region from among the regions extracted by the extracting device in accordance with a predetermined rule; a measuring device that measures luminance values of pixels contained in the region selected by the selecting device; an estimating device that estimates a function representing a degree of fog in the image received by the receiving device from the luminance values of the pixels measured by the measuring device; and an eliminating device that eliminates fog from the image received by the receiving device on the basis of the function estimated by the estimating device.