def is_on_border(bbox, im, width_border):
    """
    Checks if object is on the border of the frame.

    bbox is (min_row, min_col, max_row, max_col). Pixels belonging to the
    bounding box are in the half-open interval [min_row; max_row) and
    [min_col; max_col).
    """
    min_col = bbox[1]
    max_col = bbox[3]
    width_im = im.shape[1]
    if (min_col <= width_border) or (max_col >= width_im - width_border):
        return True
    else:
        return False