def get_roi(img, top_left, bot_right):
    """ Returns region of interest of an img given bounding box points """
    y = [max(top_left[1], 0), min(bot_right[1], img.shape[0] - 1)]
    x = [max(top_left[0], 0), min(bot_right[0], img.shape[1] - 1)]
    return img[y[0]:y[1], x[0]:x[1]]