Name

SegmentByThreshold — segments image by a threshold

Calling Sequence

SegmentedImage = SegmentByThreshold(Image, Threshold);

Parameters

Image

2D matrix of type uint8, uint16, uint32 or double

Threshold

scalar of any numeric type

SegmentedImage

boolean image of the same size as Image

Description

This function segments a numeric image by a threshold. All pixels with a gray value >= Threshold are set to %t, all other pixels to %f.

Examples

Image = rand(3, 3) // generate random image

Threshold = CalculateOtsuThreshold(Image) // determine a threshold

SegmentedImage = SegmentByThreshold(Image, Threshold)

See also

CalculateOtsuThreshold