def runway_to_cv2(bounding_box, image_width, image_height):
    """Convert Runway bounding box to OpenCV format.

    Args:
        bounding_box: bounding box in Runway format:
            (xmin, ymin, xmax, ymax) in [0,1]
            where (xmin, ymin) is the top-left corner of the rectangle and
            (xmax, ymax) is the bottom-right corner.
        image_width: width of image (number of pixels)
        image_height: height of image (number of pixels)

    Returns:
        bounding box in OpenCV format: (x, y, width, height)
            in image coordinates

    """
    (xmin, ymin, xmax, ymax) = bounding_box
    return (round(xmin * image_width), round(ymin * image_height),
            round((xmax - xmin) * image_width),
            round((ymax - ymin) * image_height))