def blacken_background(frame, thresh):
    """
    Makes the background (as defined by the given threshold) black. (Zeroes the background)
    :param frame: video frame to be processed
    :param thresh: background is defined by values < thresh
    :return:
    """
    im_rraw = frame
    threshold_r=(im_rraw < thresh)
    im_rraw[threshold_r]=0
    return im_rraw