MATLAB: Calculating PSNR

image procesing

I have two images original image and compressed image,please tell how to calculate mean square error and psnr

Best Answer

Did you see the formula at http://en.wikipedia.org/wiki/PSNR? Of course you can just subtract the images and use the sum() function instead of the loops, which I know you know how to do. Just make sure you use .^2 instead of ^2 because you want an element-by-element squaring. Give it a try - it's just one line of code.
Related Question