1. A computer implemented method for adaptive binarization to remove a defect from an image, the method comprising: receiving image data; grouping the image data into a plurality of components; identifying, in the plurality of components, at least a first data type and a second data type; processing the plurality of components to remove the at least one defect, wherein components belonging to the first data type are processed through employment of a first mode and components belonging to the second data type are processed through employment of a second mode.