rgb2gray
skimage.color.rgb2gray(rgb) [source]
Compute luminance of an RGB image. Parameters:
rgb : array_like The image in RGB format, in a 3-D array of shape (.., .., 3), or in RGBA format with shape (.., .., 4). Returns:
out : ndarray The luminance image, a 2-D array. Raises:
ValueError If rgb2gray is not a 3-D array of shape (.., .., 3) or (.., .., 4). Notes The weights used in this conversion are calibrated for contemporary CRT phosphors: Y = 0.2125 R + 0.7154 G + 0.0721 B
I