def box_to_point(box, ratio_y=0.5):
    """
    :param box: tuple (x1, y1, x2, y2)
    :param ratio_y: at what fraction from the bottom to return the point (0.5 = center point, 0.0 = bottom point)
    :return: (tuple) center point or point at specified y fraction
    """

    cx = (box.x1 + box.x2) / 2.0
    cy = (box.y1 + box.y2) / 2.0
    # dx = abs(box.x2 - box.x1)
    dy = abs(box.y2 - box.y1)

    center = (cx, cy)  # In unit
    point = (int(cx), int(cy + (0.5 - ratio_y) * dy))  # In unit. ratio_y*100% above the bottom

    return point