Calculates the Peak-to-peak signal to noise ratio of two images X and Y.
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.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.