def get_restriction(bndbox, width, height):
    """
    Restrict transform parameters.
    :param bndbox: bounding box of original object in [xmin, ymin, xmax, ymax]
    :param width: image width
    :param height: image height
    :return: a dictionary containing restrictions
    """
    xmin, ymin, xmax, ymax = bndbox
    restricts = dict()
    restricts['bbox_w'] = xmax - xmin
    restricts['bbox_h'] = ymax - ymin
    if xmin < 10:
        restricts['restrict_left'] = 1
        restricts['noflip'] = 1
    if xmax > width - 10:
        restricts['restrict_right'] = 1
        restricts['noflip'] = 1
    if ymin < 10:
        restricts['restrict_up'] = 1
        restricts['noflip'] = 1
    if ymax > height - 10:
        restricts['restrict_down'] = 1
        restricts['noflip'] = 1
    return restricts
