Watch this Author's files
This does not conform with the standard definition of PSNR.
The signal in the calculation needs to be the maximum possible signal, for example 255 for 8bit images. In your case, with dark images the value would be much too low.
For example:
img1 = double(rgb2gray(imread('lena.jpg'))); img1 = uint8(img1/4); img2 = imnoise(img1,'gaussian',0,0.0001);
figure subplot(1,2,1) imshow(img1) title('original') subplot(1,2,2) imshow(img2) title('minimal noise added') psnr = psnr(img1,img2)
psnr = 28.0867
while the value should actually be 39.9592
Contact us at files@mathworks.com