Code covered by the BSD License  

Highlights from
PSNR (Image Processing)

3.0

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

PSNR (Image Processing)

by

 

PSNR of two images

| Watch this File

File Information
Description

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

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