def channel_convert(in_c, tar_type, img_list):
    if ((in_c == 3) and (tar_type == 'gray')):
        gray_list = [cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) for img in img_list]
        return [np.expand_dims(img, axis=2) for img in gray_list]
    elif ((in_c == 3) and (tar_type == 'RGB-LAB')):
        return [cv2.cvtColor(img, cv2.COLOR_BGR2LAB) for img in img_list]
    elif ((in_c == 3) and (tar_type == 'LAB-RGB')):
        return [cv2.cvtColor(img, cv2.COLOR_LAB2BGR) for img in img_list]
    elif ((in_c == 3) and (tar_type == 'y')):
        y_list = [bgr2ycbcr(img, only_y=True) for img in img_list]
        return [np.expand_dims(img, axis=2) for img in y_list]
    elif ((in_c == 1) and (tar_type == 'RGB')):
        return [cv2.cvtColor(img, cv2.COLOR_GRAY2BGR) for img in img_list]
    else:
        return img_list
def channel_convert(in_c, tar_type, img_list):
    if ((in_c == 3) and (tar_type == 'gray')):
        gray_list = [cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) for img in img_list]
        return [np.expand_dims(img, axis=2) for img in gray_list]
    elif ((in_c == 3) and (tar_type == 'RGB-LAB')):
        return [cv2.cvtColor(img, cv2.COLOR_BGR2LAB) for img in img_list]
    elif ((in_c == 3) and (tar_type == 'LAB-RGB')):
        return [cv2.cvtColor(img, cv2.COLOR_LAB2BGR) for img in img_list]
    elif ((in_c == 3) and (tar_type == 'y')):
        y_list = [bgr2ycbcr(img, only_y=True) for img in img_list]
        return [np.expand_dims(img, axis=2) for img in y_list]
    elif ((in_c == 1) and (tar_type == 'RGB')):
        return [cv2.cvtColor(img, cv2.COLOR_GRAY2BGR) for img in img_list]
    else:
        return img_list