SIVP Toolbox
Last update : April, 2006

mat2gray - Convert matrix to grayscale image

Calling Sequence

G = mat2gray(M)
G = mat2gray(M, [mmin, mmax])

Parameters

Description

mat2gray(M,[mmin, mmax]) converts the matrix M to the double precision image. The output matrix contains values in the range [0.0, 1.0]. mmin and mmax are the values in M that correspond to 0.0 and 1.0 in the output image.

When [mmin, mmax] is not specified, minimum and maximum of M are the values in M that correspond to 0.0 and 1.0 in the output image.

Examples


    M = [0:10;0:10];
    I = mat2gray(im);

Authors

Shiqi Yu <shiqi.yu[at]gmail.com>

Availability

The latest version of SIVP can be found at

http://sivp.sourceforge.net

See Also

rgb2gray,  im2bw,  im2uint8,  im2int8,  im2uint16,  im2int16,  im2int32,  im2double,