[mmdatatype] [Up] [mmwrite] Image file I/O

mmreadgray
Read an image from a commercial file format and stores it as a gray-scale image.

Synopsis

function y = mmreadgray ( filename )

Input

filename String

Name of file to read.

Output

y Image Gray-scale (uint8 or uint16) or binary image

Description

mmreadgray reads the image in filename and stores it in y, an uint8 gray-scale image (without colormap). If the input file is a color RGB image, it is converted to gray-scale using the equation: y = 0.2989 R + 0.587 G + 0.114 B. This function calls the MATLAB function imread.

Examples

a=mmreadgray('cookies.tif');
mmshow(a);
a

See also

mmwrite Write a gray-scale image into a commercial file format.
[mmdatatype] [Up] [mmwrite]