def BGR2GRAY(img):
    b = img[:, :, 0].copy()
    g = img[:, :, 1].copy()
    r = img[:, :, 2].copy()
    out = (((0.2126 * r) + (0.7152 * g)) + (0.0722 * b))
    out = out.astype(np.uint8)
    return out
def BGR2GRAY(img):
    b = img[:, :, 0].copy()
    g = img[:, :, 1].copy()
    r = img[:, :, 2].copy()
    out = (((0.2126 * r) + (0.7152 * g)) + (0.0722 * b))
    out = out.astype(np.uint8)
    return out