Add Poisson Noise with a Given SNR in MATLAB

3k Views Asked by At

I am writing a MATLAB code where I want to add Poisson noise to images to see how well my algorithm performs. I want to test the code with a given signal to noise ratios (SNR). However, how do I add Poisson noise in order to obtain the same SNR? I have tested imnoise with MATLAB, but with a certain constant chosen, the SNR changes for image for image.

For the record, I have added noise on an image I using

Noisyimage = Constant*imnoise(I/constant, 'Poisson')

I measure the SNR as

signanoiseratio = snr(I, Noisyimage-I)
1

There are 1 best solutions below

0
On

You need to read carefully the documentation of imnoise():

J = imnoise(I,'poisson') generates Poisson noise from the data instead of adding artificial noise to the data. If I is double precision, then input pixel values are interpreted as means of Poisson distributions scaled up by 1e12. For example, if an input pixel has the value 5.5e-12, then the corresponding output pixel will be generated from a Poisson distribution with mean of 5.5 and then scaled back down by 1e12. If I is single precision, the scale factor used is 1e6. If I is uint8 or uint16, then input pixel values are used directly without scaling. For example, if a pixel in a uint8 input has the value 10, then the corresponding output pixel will be generated from a Poisson distribution with mean 10.

Namely the noise isn't added, it is a function of data.

To get what you want you need to use Poisson Random Number Generator and use it to generate noise to be added to the image (Remembering the connection between the variance and $ $ parameter of the Poisson Distribution which means they are equal).