Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Which thresholding or segmentation method do I need?

Global, Otsu's, adaptive, region growing, k-means, or watershed -- six ways to split an image into regions.

Reach for this once the goal is "split this image into foreground and background" (or into several regions), not just "find edges" -- ask first whether one fixed cutoff can possibly work for the whole image, then whether that cutoff should be chosen by hand, computed automatically, or made to vary pixel by pixel, then whether the problem is really binary at all or needs several regions and their boundaries at once.

Step 1 -- can one FIXED cutoff separate foreground from background everywhere?

One fixed cutoff T applied to every pixel in an image, foreground below it and background above it.

Example

A high-contrast scanned black-text-on-white-page document, evenly lit.

Lighting is even across the whole image and the two intensity bands genuinely don't overlap.

Computing the optimal global threshold automatically by maximizing the separation between two intensity classes.

Example

A batch of scanned pages with slightly different average exposures -- Otsu's re-computes the right T per image automatically.

A fixed cutoff will work, but you don't want to pick T by hand -- maximize the between-class variance instead.

Step 2 -- lighting varies ACROSS the image itself?

Giving every pixel its own threshold, computed from its own local neighborhood, instead of one shared global value.

Example

A photographed (not scanned) page with a shadow falling across one half.

No single T works everywhere -- give every pixel its own locally-computed threshold instead.

Step 3 -- not binary at all: several regions, or their exact boundaries?

Growing a segmented region outward from a seed pixel, admitting each neighbor only while it stays close to the region's own running mean.

Example

Growing a tumor's boundary outward from a radiologist-clicked seed in an MRI slice.

You have a good seed point and want the region that's genuinely connected and similar to it, not just similarly-colored elsewhere in the image.

Clustering pixel intensities into k groups by alternating nearest-centroid assignment and centroid recomputation.

Example

Reducing a photo to its k=5 dominant color regions for a posterized effect.

You want k regions by overall intensity/color similarity, with no seed points and no guarantee the regions are spatially connected.

Treating pixel value as elevation and flooding outward from local minima, building a dam wherever two basins would otherwise merge.

Example

Separating touching coins or cells that a simple threshold would merge into one blob.

Regions are touching and roughly equal in intensity -- you specifically need the dividing LINE between adjacent blobs, not just a rough cluster.

Full pipeline, worked through end to end

Graph settings

Calculator