PSNR Calculation without using function
显示 更早的评论
I have calculated PSNR value for an input image and its ground truth without using psnr function. I have written the following code but three different values are obtained as output.
Here's my code.
I=imread('input.png');
ref=imread('groundTruth.png');
n=size(I);
M=n(1);
N=n(2);
MSE = sum(sum((I-ref).^2))/(M*N);
PSNR = 10*log10(256*256/MSE);
fprintf('\nPSNR value of image %9.7f dB', PSNR);
The output is obtained as follows:
PSNR value of image 32.6656113 dB
PSNR value of image 32.7511297 dB
PSNR value of image 32.7349438 dB>>
Which value is correct ? Why I'm getting these three outputs ?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Image Quality 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!