[Python] Gaussian Blur Image Processing Python

Discussão em 'Python' iniciado por Stack, Junho 13, 2025.

  1. Stack

    Stack Membro Participativo

    I'm a beginner programmer and I am trying to understand this function that adds Gaussian noise to an image:

    def gaussianNoise(img):
    x, y, z = img.shape
    mean = 0
    var = 0.5
    sigma = var**0.5
    gauss = np.random.normal(mean, sigma, (x, y, z))
    noisy = img + gauss
    noisy = np.clip(noisy, 0, 1)
    return noisy


    Could someone please explain what the variables mean, var, and sigma do exactly?

    Sorry if this is a very basic question — I'm still learning and trying to get the concepts right. Thanks a lot!

    Continue reading...

Compartilhe esta Página