1. An image processing apparatus comprising: a function obtaining portion configured to obtain a first optical transfer function which is different depending on a shooting condition and on a position in an image; a corrected image generating portion configured to generate a corrected image from the image using the first optical transfer function; and an image restoration portion configured to perform blind deconvolution processing using the corrected image to generate a restored image.