1. A method for correcting for defects in a digital image taken by an image sensor when there is a pre-existing defect in at least one pixel of the image sensor which causes a line of pixels in the digital image to have corrupted data, comprising the steps of: (a) providing a defect map which identifies the position of the defective pixel and specifies the line of pixels which during readout will be caused to have corrupted data; (b) capturing the digital image in the image sensor and reading out such digital image to provide the digital image with the line of pixels in the digital image having corrupted data; (c) computing classifiers based on adjacent non-corrupted pixel data which indicate that there is a horizontal edge or a diagonal edge feature which passes through the defective column; and (d) adaptively replacing the data in the corrupted image pixels by selecting an algorithm which correponds to the edge feature identified by the classifier and using the valid data in the neighboring non-corrupted pixels of the selected edge feature.