Binary thresholding over Image using fixed, Otsu, adaptive-mean, adaptive-Gaussian, or triangle methods. Converts input to greyscale and emits either a single-channel Image foreground mask or, when consumed by a mask-typed downstream, a boolean Mask.
Typical backends
Document scan cleanup for OCR.
Background mask with morphology cleanup.
Caveats
- FallbackUnknown
method values fall back silently to otsu. - Parameter interaction
value only applies when method is fixed; otsu and triangle compute the cutoff themselves. - Parameter interaction
block_size is clamped to a minimum of 3 and silently rounded up to the next odd value; ignored by non-adaptive methods. - Parameter interaction:param:`C` is subtracted from the local mean in adaptive methods; positive values raise the threshold (shrink foreground), negative do the opposite; ignored by non-adaptive methods.
- Accuracyotsu assumes a roughly bimodal histogram and degrades on flat or low-contrast scenes; triangle is the better fallback for skewed unimodal distributions.
- I/O contractColour information is discarded before thresholding; the grayscale arm is always a single-channel GRAY image and the mask arm is a single-channel boolean foreground mask. The downstream connection picks the arm.
- State lifetimeAll parameters are captured once at first invocation; runtime changes require a redeploy.
- FallbackAn empty
Image is returned unchanged.