Segmenting images using watersheds