def correct_bounding_box(x1, y1, x2, y2):
    """ Corrects the bounding box, so that the coordinates are small to big """
    xmin = 0
    ymin = 0
    xmax = 0
    ymax = 0

    if x1 < x2:
        xmin = x1
        xmax = x2
    else:
        xmin = x2
        xmax = x1
    if y1 < y2:
        ymin = y1
        ymax = y2
    else:
        ymin = y2
        ymax = y1

    return [xmin, ymin, xmax, ymax]