def convert_x1y1x2y2_to_XcYcWH(box):
    """
        Convert box from dictionary of {"x1":,"y1":,"x2":,"y2"} to {"x_centre":,"y_centre":,"width":,"height":}
        Assumption 1: point 1 is the top left and point 2 is the bottom right hand corner
    """
    assert box["x1"] <= box["x2"]
    assert box["y1"] <= box["y2"]
    width = box["x2"] - box["x1"]
    height = box["y2"] - box["y1"]
    x_centre = round(box["x1"] + width/2)
    y_centre = round(box["y1"] + height/2)
    return {"x_centre":x_centre,"y_centre":y_centre,"width":width,"height":height}