(img)
return 0.2989 * img[..., 0] + 0.587 * img[..., 1] + 0.114 * img[..., 2]
Convert a RGB image to gray scale.
Convert a RGB image to gray scale.
Convert a RGB image to gray scale .
def rgb2gray(img):
    """Convert a RGB image to gray scale."""
    return 0.2989 * img[..., 0] + 0.587 * img[..., 1] + 0.114 * img[..., 2]
def rgb2gray ( img ) : return 0.2989 * img [ ... , 0 ] + 0.587 * img [ ... , 1 ] + 0.114 * img [ ... , 2 ]