Convert matrix to grayscale image
converts the matrix I
= mat2gray(A
,[amin amax]
)A
to an intensity image
I
that contains values in the range 0 (black) to 1 (white).
amin
and amax
are the values in
A
that correspond to 0 and 1 in I
.
Values less than amin
become 0, and values greater than
amax
become 1.
You optionally can perform the operation using a GPU (requires Parallel Computing Toolbox™). For more information, see Image Processing on a GPU.