필터 지우기
필터 지우기

How to calculate PSNR of a double sized image

조회 수: 2 (최근 30일)
ayushi
ayushi 2016년 7월 15일
댓글: Balasubramanian Durairajan 2018년 10월 20일
While executing there is a error on command window how to remove this error:
%%psnr and mse
err = immse(im, K);
fprintf('\n The mean-squared error is %0.4f\n', err);
[peaksnr, snr] = psnr(im2double(im, K));
fprintf('\n The Peak-SNR value is %0.4f', peaksnr);
fprintf('\n The SNR value is %0.4f \n', snr);
Errors while executig the code :
??? Undefined function or method 'immse' for input arguments of type 'double'.
Error in ==> UNTITLED>pushbutton2_Callback at 316
err = immse(im, K);

답변 (2개)

Walter Roberson
Walter Roberson 2016년 7월 15일
immse() is for calculating Mean Squared Error (MSE), but you want to calculate PSNR.
immse() was added to the Image Processing Toolbox as of R2014b.
psnr() was added to the Image Processing Toolbox as of R2014a.
  댓글 수: 2
ayushi
ayushi 2016년 7월 19일
ok thank you sir
Spandan Tiwari
Spandan Tiwari 2016년 7월 20일
Slightly aside, but relevant - there's another image similarity metric computing in the Image Processing Toolbox called ssim() for Structural Similarity Index.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2016년 7월 20일
I have a manual way to do it, before they introduced those built-in functions. It's attached.

Community Treasure Hunt

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

Start Hunting!

Translated by