I have written the following matlab code for producing a noisy image corrupted by Cauchy noise but when I compute the psnr value of the noisy image using psnr function in matlab, it returns a negative value while according to the paper that I have implemented its results, the psnr value for the cameraman test image of size 256 by 256 and 0.02 of Cauchy noise must be around 19. I appreciate it if someone could please help me to solve this problem.
The image intensity range is [0,1] for cameraman test image.
refimg = im2double(imread('cameraman.png')); % original image
img_height = size(refimg,1);
img_width = size(refimg,2);
refimg = refimg(1:img_height,1:img_width);
rng(0);
r1 = random('Normal',0, 1,[img_height img_width]);
r2 = random('Normal',0, 1,[img_height img_width]);
n = 0.02; % the noise level
u0 = refimg + n.*(r1./r2);
figure(1); imshow(u0);
PSNR_noisy = psnr(refimg,u0)