Binarize

Binarize

Transforms any gray-level or color image to a binary image using a static gray-level threshold.

Inputs

image
Input image
level
Gray-level threshold. Every pixel with a gray level less than the threshold is regarded as background.
invert
Inversion flag. If this value is true, inverts the result so that pixels whose gray level is less than level are regarded as foreground.

Outputs

image
Binary image. Background is zero, foreground one.