A parallel clustering algorithm for image segmentation