Skip to content
ExtendedSource checked

Watershed Segmentation

Segments regions by treating image intensity as a terrain flooded from markers.

Quick Facts

Compact metadata for implementation and discovery.

Category
Image Processing
Difficulty
Advanced
Family
Image Segmentation
Tier
Extended
Status
Verified
Review
Source Checked
Sources
2
Formulas
0
Relationships
2
Code example
Ready
Visualization
Ready

Overview

Watershed segmentation grows basins from local minima or markers until boundaries meet at ridges in the image surface.

Core Concepts

intensity terraincatchment basinmarkerregion boundary

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(pixels log pixels)

Average

O(pixels log pixels)

Worst

O(pixels log pixels)

Space

O(pixels)

When to Use

  • Use when image enhancement needs intensity terrain.
  • Use when the input matches the assumptions behind image Segmentation.

When Not to Use

  • Avoid when image noise, lighting, or scale breaks the algorithm's assumptions.
  • Avoid when a simpler algorithm gives the required result with less setup.

What It Does

  • Segments regions by treating image intensity as a terrain flooded from markers
  • Uses intensity terrain and catchment basin to guide the work.
  • Produces processed image.

Use Cases

  • Image enhancement
  • Feature extraction
  • Segmentation and motion analysis

Inputs

  • Image or image sequence
  • Kernel, threshold, or model parameters

Outputs

  • Processed image
  • Mask
  • Feature map or motion field

Pseudocode

  1. 1.Prepare the inputs and state needed for Watershed Segmentation.
  2. 2.Apply the intensity terrain step while the stopping condition has not been met.
  3. 3.Update intermediate state and discard invalid candidates.
  4. 4.Return processed image.

Canonical Example

Input
Watershed Segmentation input with a small representative case
Output
Processed image
Explanation
Watershed Segmentation applies intensity terrain to produce processed image.

Implementation Notes

  • Handle borders and pixel coordinate conventions consistently.
  • Keep the intensity terrain step separate enough to test independently.

Common Pitfalls

  • Applying operations in the wrong color space can distort the result.
  • Forgetting to check edge cases can make Watershed Segmentation look correct on only ideal inputs.

Interactive Mechanism Walkthrough

Spatial Primitive & Sweep-Line Canvas

Show the source image beside masks, filters, or motion vectors produced by the algorithm.

Watershed Segmentation mechanism walkthrough step 1 of 4
Step 1 of 4: Prepare the inputs and state needed for Watershed Segmentation.
image-processing-mechanism

Notes

Watershed Segmentation should be used with the assumptions and tradeoffs of image Segmentation in mind.

Sources (2)

What each reference supports for this entry.

Vincent-Soille Watersheds

Paper

Reference for watershed segmentation using immersion-style flooding and catchment basins.

Open source

Digital Image Processing

Book

Image-processing textbook support for Watershed Segmentation filtering, morphology, segmentation, restoration, or connected-component behavior.

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Often paired withMorphological Dilation

Watershed segmentation is often paired with morphological cleanup of markers and regions.

Tags

Image ProcessingSegmentationMorphologyGraph