Effacer les filtres
Effacer les filtres

Adding poisson noise to a self made image

15 vues (au cours des 30 derniers jours)
Moosejr
Moosejr le 28 Déc 2022
Modifié(e) : Moosejr le 28 Déc 2022
Hi,
I have seen similar questions
to my own before, but unfortunately I have not managed to fix it. I want to use imnoise to apply a Poisson noise to an image. I suspect my problem is that I don't really understand the necessary scaling which in the documentation is supposed to be 1e12 or 1e6. As far as I understand this number is supposed to correspond to the number of photons per pixel. The Poisson distribution is , where as I understand λ is the expected number of photons per pixel, and k is the actual number of photons per pixel.
My code is the following:
imageSizeX = 500;
imageSizeY = 420;
image=zeros(imageSizeX,imageSizeY,3)+1; %initialize white background
image(150:350,190:240,1:3)=0; %Black object
imgGauss = imnoise(image,'gaussian'); %Adds Gaussian white noise
imgPoisson = imnoise(image/1e12,'poisson'); %Adds Poisson noise
figure(1)
imshow(image)
figure(2)
imshow(imgGauss)
figure(3)
imshow(imgPoisson)
The output of imshow(imgPoisson) is just a black image. Can anyone enlighten me, and hopefully others, how one is supposed to use the imnoise function with a very basic example as the one shown above?

Réponses (0)

Produits


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by