calculating PSNR

13 ビュー (過去 30 日間)
kash
kash 2012 年 3 月 21 日
I have two images original image and compressed image,please tell how to calculate mean square error and psnr

採用された回答

Image Analyst
Image Analyst 2012 年 3 月 21 日
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.
  3 件のコメント
Image Analyst
Image Analyst 2012 年 3 月 21 日
Looks like it should be as long as origImg & compImg are floating point images and not uint8 or uint16. I was thinking of something like
MSE = mean2((single(image1) - single(image2)).^2);
kash
kash 2012 年 3 月 22 日
Thanks MR.Analyst

サインインしてコメントする。

その他の回答 (1 件)

Wayne King
Wayne King 2012 年 3 月 21 日
The Wavelet Toolbox has a function for this, measerr()
>>doc measerr
  2 件のコメント
kash
kash 2012 年 3 月 21 日
Wayne i am getting page not found,am using 2010a
Wayne King
Wayne King 2012 年 3 月 21 日
introduced in R2010b

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by