A recording medium storing a program for detecting defective pixels, the program being capable of determining defective pixels as correction target in an imaging device that produces image signals, the program causing a computer to function as:
- a defect information storage storing priority of defective pixels to be corrected;
- a defective pixel detector detecting defective pixels by comparing levels of imaging signals from the imaging device with a predetermined detection level;
- a priority setter setting priority of the detected defective pixels, based on the levels of the imaging signals of the defective pixels detected by the defective pixel detector;
- and
- a correction target determiner newly determining defective pixels to be corrected based on the priority of the defective pixels out of the defective pixels that have been detected this time by the defective pixel detector and the defective pixels to be corrected stored in the defect information storage, determining priority of the newly determined defective pixels to be corrected, and storing the priority of the newly determined defective pixels to be corrected in the defect information storage.