1. A computerized method of binarizing a grayscale image, comprising: determining a first threshold that yields optimal binarization values to one or more images in a set of images; a processor calculating the histograms of each of said one or more images determined using the first threshold; the processor calculating a set of statistics of each said histogram; determining a second threshold as a function of said set of statistics; and comparing each pixel of said grayscale image to said second threshold, whereby grayscale values above said second threshold are assigned a first binarization value and grayscale values below said second threshold are assigned a second binarization value.