I have written the following code to produce Cauchy noise for an image when the image intensity range is [0,1]:
refimg = im2double(((imread('parrot.png')))); % original image
img_height = size(refimg,1);
img_width = size(refimg,2);
r1 = random('Normal',0, 1,[img_height img_width]);
r2 = random('Normal',0, 1,[img_height img_width]);
n = 0.04; % the noise level
u0 = refimg + n.*(r1./r2);
figure(1); imshow(u0);
And this is the result that I obtained:
Now I want to change the intensity range of my reference image to [0,255] and produce the noisy image corrupted by the Cauchy noise. For this purpose, I changed the first line to
refimg = im2double(((imread('parrot.png')))).*255; % original image
and the last line to:
figure(1); imshow(u0,[]);
But this is the output:
I appreciate it if someone could please help me to find the problem with my code when the image intensity range is [0,255].


