Rather than storing a table within a digital camera or other optical
device of defective pixels within its image sensor, defective pixels are
dynamically identified by comparing the output values of individual
pixels under test with those of neighboring pixels. If the neighbors are
all above or below the pixel under test by a defined threshold amount,
the output of the pixel under test is replaced with a value calculated
from the outputs of neighboring pixels.