View License

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

» Watch video

Highlights from
PSNR (Image Processing)

3.0 | 1 rating Rate this file 18 Downloads (last 30 days) File Size: 1.15 KB File ID: #37326 Version: 1.0

PSNR (Image Processing)



PSNR of two images

| Watch this File

File Information

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

Required Products MATLAB
MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
15 Jul 2012 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.

Contact us