Question

I am trying to add poisson noise to an image with doulbe precision. I do:

I = im2double(imread('mypic.tif')); % mypic.tif is already in the range 0...1 in double precision
J = imnoise(I,'poisson');
imshow(I),figure,imshow(J);

I see that both I and J are pretty the same. What I am doing wrong?
Please note I do know that imnoise scales the value by 1e-12 but sincerly I don't understand how to use it correctly.

I was thinking I could use poissrnd() to add noise manually to bypass imnoise

Regarding the scaling i was using a code like this:

maxValue = max(I(:));

% This is necessary based on imnoise behaviour
I = I * 10e-12;

% Generate noisy image and scale back to the original intensities. 
J = maxValue * imnoise(I, 'poisson'); 

But it returns an image almost completly black.

Was it helpful?

Solution

As the link says, this is a large number problem.

Try using a smaller scale:

I = im2double(imread('eight.tif')); %Matlab default image
scale = 1e9;
J = scale * imnoise(I/scale, 'poisson'); 
close all; imshow(J);

Input:

enter image description here

Output (1e9):

enter image description here

Output (1e10):

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top