Adaptive thresholding: A comparative study