A Multilevel Method for Image Segmentation