A computer program product that causes a computer to execute image data processing that receives input of image data representing an image taken by an imaging unit and processes the input image data, said computer program product comprising:
- a computer recording medium;
- and
- a computer program stored in said computer recording medium,
- said computer program comprising:
- a first program of receiving the image data as unprocessed raw data and as a set of pixel data, which include luminance data representing luminance values of respective pixels constituting the imaging unit;
- a second program of mapping the input image data to an array of the respective pixels constituting the imaging unit;
- a third program of comparing the luminance data of each target pixel as an object of detection with the luminance data of at least one adjoining pixel adjacent to the target pixel and detecting a pixel defect according to a result of the comparison, and when the target pixel is determined to be defective, determining a state of being of the defective pixel;
- a fourth program of correcting the luminance data of an identified defective pixel, which is detected as the pixel defect by said third program, with the luminance data of at least one adjoining pixel adjacent to the identified defective pixel, in different manners depending upon a state of being of the defective pixel, and updating, in the different manners, the luminance data of the pixel data allocated to the defective pixel by said second program to the corrected luminance data;
- a fifth program of relating a position of the identified defective pixel to the imaging unit that has the defective pixel and storing the position in the array of the pixels constituting the imaging unit;
- a sixth program of editing the image data including the updated luminance data of the identified defective pixel and generating edited image data;
- and
- a seventh program of outputting the edited image data,
- wherein the correcting and updating of the luminance data in said fourth program, in response to further input of another image data from the imaging unit that has the defective pixel after storage of the position of the defective pixel in said fifth program, automatically corrects the luminance data of a certain pixel at the stored position of the defective pixel with the luminance data of at least one adjoining pixel adjacent to the certain pixel and updates the luminance data of the certain pixel to the corrected luminance data,
- wherein the determining a state of being of the defective pixel in said third program determines whether the defective pixel is isolated or whether multiple defective pixels are collectively present, and
- wherein said correcting and updating of the luminance data in said fourth program corrects the luminance data of an identified defective pixel with the luminance data of at least one decent adjoining pixel adjacent to the identified defective pixel when the defective pixel is isolated, and corrects the luminance data of the identified defective pixel with the luminance data of the at least one adjoining decent pixel adjacent to the identified defective pixel and the luminance data of at least one adjoining defective pixel adjacent to the identified defective pixel only when the luminance data of the at least one adjoining defective pixel has been corrected, when multiple defective pixels are collectively present.