A white reference image is inputted to an image sensor with a light source
lit up, and white reference data is set every effective photosensor
element by inspecting the output signals of the image sensor as to the
white reference image (steps S305 and S310). After the input of the white
reference image, the light source is extinguished (point e in FIG. 1), a
black reference image is inputted to the image sensor (step S315), and
black reference data is set every effective photosensor element by
inspecting the output signals of the image sensor as to the black
reference image (step S320). After the light source is lit up (point f in
FIG. 1), the optical image of a subject is inputted to the image sensor,
and image data outputted to shading corrections with the white reference
data and the black reference data are outputted (step S330)