1. An image processing apparatus comprising: a first acquisition unit configured to calculate a variation of a pixel value in a block among a plurality of blocks of an image and obtain identification information based on the variation, a second acquisition unit configured to calculate a minimum value and a maximum value from a pixel value of a region of the image determined based on the identification information and obtain information to be used for image processing, and an image processing unit configured to perform image processing which enhances a contrast of the image by converting a range of the minimum value and maximum value into a predetermined pixel value range based on the information obtained by the second acquisition unit.