1. An image processing apparatus comprising: a weight calculation unit configured to calculate a weight of a weighted smoothing filter; a first filter unit configured to generate a smoothed image by applying the weighted smoothing filter to an input image; and a second filter unit configured to obtain a feature image by dividing a pixel value of each pixel of the input image by a pixel value of corresponding pixel of the smoothed image, wherein the weight calculation unit includes: (1) a diffuse reflection image generation unit configured to generate a diffuse reflection image by using a model having a diffuse reflection component as a main component, the diffuse reflection image approximating the input image, and (2) a difference image generation unit configured to generate a difference image between the diffuse reflection image and the input image, and the weight calculation unit evaluates a difference value between pixel values of each noted pixel and its surrounding pixel in the difference image, and assigns to the surrounding pixel a weight that decreases with increase of the difference value.