[mmbench] [Up] [mmfreedom] Data Type Conversion

mmbinary
Convert a gray-scale image into a binary image

Synopsis

y = mmbinary ( f , k1 = 1 )

Input

f Image Unsigned gray-scale (uint8 or uint16), signed (int32) or binary image

k1 Double

Threshold value.

Default: 1 (1)

Output

y Image Binary image

Description

mmbinary converts a gray-scale image f into a binary image y by a threshold rule. A pixel in y has the value 1 if and only if the corresponding pixel in f has a value greater or equal k1.

Examples

a = array([0, 1, 2, 3, 4])
b=mmbinary(a)
print b
            
[False  True  True  True  True]
a=mmreadgray('mm3.tif')
b=mmbinary(a,82)
mmshow(a)
mmshow(b)
            
a b

Equation

See also

mmthreshad Threshold (adaptive)
mmisbinary Check for binary image
mmgray Convert a binary image into a gray-scale image.
[mmbench] [Up] [mmfreedom]