An image processing apparatus includes a blur reproducing unit that
generates blur-reproduced image data by reproducing a predetermined blur
of a lens, with respect to blur-corrected image data of which an initial
data is input image data inputted from an image sensor; a blur correcting
unit that corrects the blur-corrected image data so that an error between
the blur-reproduced image data and the input image data becomes smaller;
and a curved-surface fitting unit that obtains curve surface parameters
of each functions approximating distribution of pixel values of each of
color components of the blur-corrected image data so that curved-surface
shapes of the functions become the same among the color components, and
updates the pixel values of the blur-corrected image data by using the
curve surface parameters.