Adding poisson noise to a self made image

조회 수: 55 (최근 30일)
Moosejr
Moosejr 2022년 12월 28일
답변: Jaimin 2025년 1월 3일
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?

답변 (1개)

Jaimin
Jaimin 2025년 1월 3일
It seems that you are trying to add Poisson noise to an image using MATLAB's imnoise function, but you are encountering an issue with scaling.
The Poisson noise is often used to simulate photon noise in imaging systems. The magnitude of the noise is related to the number of photons (or counts) per pixel. In imnoise, the Poisson noise is applied based on the image intensity values. The key is to ensure these values are scaled appropriately to represent photon counts.
In the given code,the image is being scaled by “1e12”, which might be too large and result in very low intensity values in the image (close to zero), leading to a black image after noise application.
Ensure that the image intensity values are within a reasonable range, particularly for Poisson noise, where values should represent photon counts. If the original image values range from [0, 1], extreme scaling might not be necessary. However, to simulate higher photon counts, we can scale the image by a factor such as 255 or 65535, corresponding to 8-bit or 16-bit images, respectively.
For more information kindly refer following MathWorks documentation.

카테고리

Help CenterFile Exchange에서 Photonics에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by