def get_roi(countours, img_height, img_width):
    """
    Computes bounding box which must contain all the passed contours 
    
    Arguments:
    contours -- numpy array of shape [num_points, 1, 2]
    img_height -- int, image height
    img_width -- int, image width

    Returns:
    4 numbers representing x and y coordinates of bottom left and upper right corners of the resulting ROI
    """

    miny, maxy = float('inf'), -float('inf')
    minx, maxx = float('inf'), -float('inf')
    for item in countours[:, :]:
        x, y = item[0]
        miny = min(y, miny)
        maxy = max(y, maxy)
        
        minx = min(x, minx)
        maxx = max(x, maxx)
    
    offset = 15
    minx = max(minx - offset, 0)
    maxx = min(maxx + offset, img_width)
    miny = max(miny - offset, 0)
    maxy = min(maxy + offset, img_height)

    return int(minx), int(maxx), int(miny), int(maxy)