def ignore_background(array, num_classes, ignore=0):
    """
    :param array: [*],values in [0,num_classes)
    :param num_classes: C
    :param ignore: ignore value of background, here is 0
    :return: [*] which ignore_index=num_classes
    """
    array[array == ignore] = -1
    array[array > ignore] -= 1
    return array