No BSD License  

Highlights from
PSNR- Peak Signal to Noise Ratio

Be the first to rate this file! 32 Downloads (last 30 days) File Size: 598 Bytes File ID: #22583

PSNR- Peak Signal to Noise Ratio

by Aviad Dido

 

05 Jan 2009

compute the Peak Signal to Noise Ratio of two images

| Watch this File

File Information
Description

defined by :
PSNR(x,y) = 10*log10( max(max(x),max(y))^2 / |x-y|^2 ).

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
03 Jul 2011 Adi Navve

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

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
image processing Aviad Dido 05 Jan 2009 16:10:28
mathematics Aviad Dido 05 Jan 2009 16:10:28
psnr Aviad Dido 05 Jan 2009 16:10:28
image restoration Aviad Dido 05 Jan 2009 16:10:28

Contact us at files@mathworks.com