def overlayImageWithConfidence(in_image, conf, vis_channel = 1, threshold = 0.5):
    '''
    
    :param in_image:
    :param conf:
    :param vis_channel:
    :param threshold:
    '''
    if in_image.dtype == 'uint8':
        visImage = in_image.copy().astype('f4')/255
    else:
        visImage = in_image.copy()
    
    channelPart = visImage[:, :, vis_channel] * (conf > threshold) - conf
    channelPart[channelPart < 0] = 0
    visImage[:, :, vis_channel] = visImage[:, :, vis_channel] * (conf <= threshold) + (conf > threshold) * conf + channelPart
    return visImage

    
    :param in_image:
    :param conf:
    :param vis_channel:
    :param threshold:
    
submodules/evaluation/kitti_devkit/helper.py