1. An image processing apparatus comprising: imaging means for capturing an image using a sensor with pixels and generating a digital representation thereof in the form of image data; a memory in which is stored defective pixel information identifying defective pixels in the sensor; and a processing system configured to communicate with the imaging means and the memory and to process the image data and correct the image data for defective pixels, wherein the processing system includes an array storage section in which at least some of the image data are stored, including noticed pixel image data corresponding to a noticed pixel, a defective-position section into which data from the memory are stored at a predetermined time, a relating section configured to correlate image data in the array storage section with the data in the defective-position section, a reading section in communication with the array storage section and configured to identify prediction pixel image data corresponding to prediction pixels located at predetermined distances from the noticed pixel, a prediction-coefficient storage section in which are stored prediction coefficients corresponding to the prediction pixels, and a calculation section in communication with the prediction-coefficient section and the reading section and configured to calculate a correction value for the noticed pixel image data using the sum of the products of the prediction pixel image data and their prediction coefficients, and wherein the processing system groups the prediction pixels into a plurality of groups in accordance with their predetermined distances from the noticed pixel, and the calculation section calculates the correction value using the prediction pixel image data for prediction pixels in a group nearest the noticed pixel which are not all defective pixels.