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

    Args:
        bounding_box: bounding box in OpenCV format: (x, y, width, height)
            in image coordinates
        image_width: width of image (number of pixels)
        image_height: height of image (number of pixels)

    Returns:
        Runway format bounding box (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.

    """
    (x, y, width, height) = bounding_box
    return (x/image_width, y/image_height,
            (x + width)/image_width, (y + height)/image_height)