def fliplr_label(window, im_width, matched_parts):
    """
    flip coords
    window: [lt, lb, rb, rt]
    width: image width
    matched_parts: list of pairs
    """
    for idx in range(len(window)):
        corner = window[idx]
        # Flip horizontal
        corner[:, 0] = im_width - corner[:, 0] - 1

    # Change left-right parts
    for pair in matched_parts:
        window[pair[0]], window[pair[1]] = window[pair[1]].copy(), window[pair[0]].copy()

    return window