What is the Watershed algorithm, and how is it used for image segmentation?

Technical