[mmfreedom] [Up] [mmframe] Data Type Conversion

mmgray
Convert a binary image into a gray-scale image.

Synopsis

y = mmgray ( f , TYPE = "uint8", k1 = Null )

Input

f Image Binary image

TYPE String

Image data type: 'uint8', 'uint16', or 'int32'.

Default: "uint8" ('uint8')

k1 Double Non-negative integer.

Default: Null

Output

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

Description

mmgray converts a binary image into a gray-scale image of a specified data type. The value k1 is assigned to the 1 pixels of f, while the 0 pixels are assigned to the minimum value associated to the specified data type.

Examples

b=mmbinary([0, 1, 0, 1])
print b
[False  True False  True]
c=mmgray(b)
print c
[  0 255   0 255]
d=mmgray(b,'uint8',100)
print d
[  0 100   0 100]
e=mmgray(b,'uint16')
print e
[    0 65535     0 65535]
f=mmgray(b,'int32',0)
print f
[-2147483647           0 -2147483647           0]

Equation

See also

mmfreedom Control automatic data type conversion.
mmbinary Convert a gray-scale image into a binary image
mmthreshad Threshold (adaptive)
mmis Verify if a relationship among images is true or false.
[mmfreedom] [Up] [mmframe]