source/utils.py
def convert_rgb_to_y(img, dim_order='hwc'):
    """ Get Y(CbCr) value from RGB image (standard conversion)

    :param img: input image array in RGB form
    :return: array of Y values

    """

    if dim_order == 'hwc':
        return 16. + (64.738 * img[..., 0] + 129.057 * img[..., 1] + 25.064 * img[..., 2]) / 256.
    else:
        return 16. + (64.738 * img[0] + 129.057 * img[1] + 25.064 * img[2]) / 256.
 Get Y(CbCr) value from RGB image (standard conversion)

    :param img: input image array in RGB form
    :return: array of Y values

    
Get Y(CbCr) value from RGB image (standard conversion)
Get Y ( CbCr ) value from RGB image ( standard conversion )
def convert_rgb_to_y(img, dim_order='hwc'):
    if dim_order == 'hwc':
        return 16. + (64.738 * img[..., 0] + 129.057 * img[..., 1] + 25.064 * img[..., 2]) / 256.
    else:
        return 16. + (64.738 * img[0] + 129.057 * img[1] + 25.064 * img[2]) / 256.
def convert_rgb_to_y ( img , dim_order = 'hwc' ) : if dim_order == 'hwc' : return 16. + ( 64.738 * img [ ... , 0 ] + 129.057 * img [ ... , 1 ] + 25.064 * img [ ... , 2 ] ) / 256. else : return 16. + ( 64.738 * img [ 0 ] + 129.057 * img [ 1 ] + 25.064 * img [ 2 ] ) / 256.
Get Y(CbCr) value from RGB image (standard conversion)
Get Y ( CbCr ) value from RGB image ( standard conversion )
""" Get Y(CbCr) value from RGB image (standard conversion)

    :param img: input image array in RGB form
    :return: array of Y values

    """
array of Y values
array of Y values
img
input image array in RGB form
input image array in RGB form
dim_order