adding binary thresholding