<< ind2rgb SIVP - Scilab Image and Video Processing Toolbox mean2 >>

SIVP - Scilab Image and Video Processing Toolbox >> SIVP - Scilab Image and Video Processing Toolbox > mat2gray

mat2gray

Convert matrix to grayscale image

Calling Sequence

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

Parameters

M
An matrix/image.
[mmin, mmax]
[mmin, mmax] is the values in M that correspond to 0.0 and 1.0 in G. The elements in M which is lower than mmin will be converted to 0.0, and greater than mmax will be converted to 1.0.
G
A double precision matrix/image which data value in the range [0,1].

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

Availability

The latest version of SIVP can be found at

http://sivp.sf.net

See Also

<< ind2rgb SIVP - Scilab Image and Video Processing Toolbox mean2 >>