File Exchange

image thumbnail

PSNR (Image Processing)

version 1.0 (1.15 KB) by

PSNR of two images



View License

Calculates the Peak-to-peak signal to noise ratio of two images X and Y.

Comments and Ratings (1)

Cris Luengo

Cris Luengo (view profile)

Not a good example of good programming!

You can do exactly the same with:

X = double(X);
Y = double(Y);
m = sum((X(:)-Y(:)).^2) / prod(size(X));
psnr = 10*log10(255*255/m);

However, instead of assuming the peak is 255, you should use max(X(:)) as the peak.

MATLAB Release
MATLAB 7.0.1 (R14SP1)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video