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

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

Synopsis

function y = mmgray ( f , TYPE , k1 )

Input

f Image Binary image
TYPE String

Default: 'uint8'

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

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]);
Warning: converting image from double to int32
c = mmgray(b)
c =
    0  255    0  255
d = mmgray(b,'uint8',100)
d =
    0  100    0  100
e = mmgray(b,'uint16')
e =
      0  65535      0  65535
format short g
f = mmgray(b,'int32',0)
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]