Acceleration of Thresholding and Labeling Operations through Geometric Processing of Gray-Level Images