2

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.

dynamic
  • 46,985
  • 55
  • 154
  • 231
  • 1
    Keep in mind that the vast majority of images have an 8-bit depth per channel (red, blue, green, gray, etc.), meaning 256 distinct values, even if mapped to `0..1`. In order to make a difference in a pixel, the noise threshhold must be > 1/256 ~= 4e-3. If your Poisson source is really scaled to 1e-12, that's *way* below the threshhold... – twalberg Feb 27 '13 at 17:41

1 Answers1

2

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

Smash
  • 3,722
  • 4
  • 34
  • 54