1. An image processing apparatus comprising: an image acquisition unit configured to acquire, as an image, on an image sensor unit, light traveling from an object via an opening of a stop; a control unit configured to control a shape of the opening based on a function which defines a temporal change of the shape of the opening when said image acquisition unit acquires the image; a decision unit configured to utilize the function to decide a distance to the object captured in the image, based on a blur state of the object in the image; and a holding unit configured to hold a blur pattern derived from the function, wherein the decision unit is configured to decide a distance to the object based on a correlation between the blur state of the object in the image and the blur pattern.