Adding poisson noise to a self made image
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1245362/image.png)
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?
0 commentaires
Réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!