1. A computer implemented method for adaptive binarization to remove a defect from an image, the method comprising: receiving image data; performing bit plane slicing on the image data to produce a plurality of bit planes; analyzing the plurality of bit planes to identify a target bit plane; removing recognized text from the target bit plane; analyzing the target bit plane to determine a positional boundary for a defect in the image data; and processing the target bit plane to remove the defect, wherein a first threshold value is used for data within the positional boundary and a second threshold value is used for data outside the positional boundary.