def square_bbox(bbox, side):
    """Reshape a bounding box so that it has the same center but all sides are
    size `side`."""
    bbox_sides = bbox[1, :] - bbox[0, :]
    pads = side - bbox_sides
    bbox[0, :] -= pads // 2
    bbox[1, :] = bbox[0, :] + side
    return bbox