1. An image processing apparatus that calculates weight values based on difference values between a pixel value of a pixel position in an image data and pixel values of pixels of a peripheral region of the pixel position, calculates expectation values of the pixel values of the peripheral region on the basis of weight values calculated for the pixels in the peripheral region, and makes the expectation values be the calculation results of the pixel position, the image processing apparatus comprising: a plurality of normalized weighting functions for calculating the weight values; a unit that calculates the total sum of weights of all the pixels in the peripheral region, for the plurality of normalized weighting functions; a unit that selects one of the normalized weighting functions on the basis of the total sum of the weight values; and a unit that calculates the expectation values of the pixel values in the peripheral region based on the selected normalized weighting function.