Use of watersheds in contour detection