1. A method for correcting for defects in a digital image taken by an image sensor when there are pre-existing defects in two pixels in adjacent columns of the image sensor which causes two adjacent lines 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 pixels and specifies the two adjacent lines 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 two adjacent lines 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 lines of pixels; 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.