def threshold(pred, param):
    """
    Takes the predicted image "pred", thresholds it with the determined
    param, returns binary image.

    Parameters
    ----------
    pred : np.array
        Prediction image
    param : float
        Threshold for the input image

    Returns
    -------
    np.ndarray
        Binary np.array
    """

    pred[pred >= param] = 1
    pred[pred < param] = 0

    return pred