otsu · segmentation · HALCON: binary_threshold

image → region

Global automatic thresholding by Otsu's method. It scans every possible threshold of the intensity histogram and picks the one that maximises the between-class variance of the foreground/background split. No manual threshold is needed, which makes it a robust default for bimodal images (an object against a distinct background).

Arguments

abias applied to the automatic threshold (nudge the cut up/down).
breserved.

Usage

Produces a binary region ({0,1}) — the foreground mask. Feed it to region ops (fill_holes, select_largest) or count blobs with blob_count.

Sample code

gaussian 0.3 0.5
otsu 0.5 0.5
fill_holes 0.5 0.5
blob_count 0.5 0.5

Load this pipeline  ·  Load & run

Related operators

threshold · dyn_threshold · adaptive_gauss_thresh · canny

Provenance: Otsu 1979, "A Threshold Selection Method from Gray-Level Histograms". See docs/PROVENANCE.md.