1. An image processing apparatus comprising: imaging means for capturing an image of an object of shooting; defective-position storing means for storing a position of a defective pixel of the imaging means; arraying means for arraying a plurality of pixels in a certain range of the vicinity of a noticed pixel of the image of the object of shooting output by the imaging means; when the noticed pixel is the defective pixel, prediction-pixel obtaining means for obtaining prediction pixels located at relative positions predetermined with respect to the noticed pixel and to be used for correcting the defective pixel out of the arrayed pixels; prediction-coefficient supplying means for supplying prediction coefficients corresponding to the prediction pixels; and calculation means for calculating a correction value of the noticed pixel by the sum of the products of the prediction pixels and the prediction coefficients.