def weight_normalization(weight1, weight2):
    """
    A function to normalize the weights of each modality so the weights' sum is 1 for each pixel of the image

    :param weght1: The weight of madality 1, a grayscale image
    :param weight2: The weight of modality 2, a grayscale image
    :return: Two weights, weight1_normalized and weight2_normalized, respectively the normalized versions of weight1 and weight2, two grayscale images.
    """

    weight1_normalized = weight1 / (weight1 + weight2)
    weight2_normalized = weight2 / (weight1 + weight2)
    return weight1_normalized, weight2_normalized