How to add Gaussian noise to an image?

Donatas picture Donatas · Oct 25, 2015 · Viewed 14.5k times · Source

How to add a certain amount of Gaussian noise to the image in python? Do I need to convert somehow the values of the image to double type or something else?

Also, I have doubts about measuring the level of noise in the image. One adds it according to the dB (decibels) while other considers the variance. How it is related and how should I measure the noise level?

Answer

Anand picture Anand · Oct 25, 2015

You can use the random_noise function in scikit-image. It goes something like this:

skimage.util.random_noise(image, mode='gaussian', seed=None, clip=True, **kwargs)

You can read more about it here: http://scikit-image.org/docs/stable/api/skimage.util.html#random-noise