cmap2gray
Syntax
Description
Examples
Input Arguments
Output Arguments
Algorithms
The cmap2gray
function converts RGB values to grayscale values by
forming a weighted sum of the R, G, and
B components:
0.298936021293775 * R + 0.587043074451121 * G + 0.114020904255103 * B
The coefficients used to calculate grayscale values in the cmap2gray
function are identical to those used to calculate luminance (E'y) in Rec.ITU-R BT.601-7 after
rounding to three decimal places. Rec.ITU-R BT.601-7 calculates E'y using this formula:
0.299 * R + 0.587 * G + 0.114 * B
Extended Capabilities
Version History
Introduced in R2020b
See Also
im2gray
| rgb2gray
| rgb2ind
| rgb2lightness
(Image Processing Toolbox)