Sequential and Parallel Thresholding of Images