I'm trying to add white noise to an image after applying a lowpass filter. I know how to do it in matlab but don't know what to call for it to work in python.
import matplotlib.pyplot as plt
import numpy as np
import scipy.misc
from scipy import ndimage
import Image
J = imnoise(im,'salt & pepper',0.02);
figure.imshow(J)
What else do I need to import? Or is there another way to add noise?
in discussing denoising, this tutorial adds white noise to an image with noisy = l + 0.4 * l.std() * np.random.random(l.shape)
where l
is the image.
http://scipy-lectures.github.io/advanced/image_processing/#denoising
In general, you should be able to add noise simply by adding a matrix filled with the noise that you want to use to the original picture.