How can I calculate the PSNR of two images in matlab? The images are obtained as intermediate results. How can I use these images to calculate the PSNR value
1 次查看(过去 30 天)
显示 更早的评论
How can I calculate the PSNR of two images in matlab? The images are obtained as intermediate results. How can I use these images to calculate the PSNR value
采纳的回答
Walter Roberson
2015-8-18
Yes, PSNR can be negative. It is 10 * log10() of a ratio, so if the ratio is less than 1 then log10() is negative and so the PSNR would be negative.
3 个评论
Walter Roberson
2015-8-18
nI and I would have to be double() for that to work -- or rather, they could not be uint8() or any other unsigned class.
I = double(YourImage);
for K = 1 : 20
nI = I + randn(size(I)) * 1.2345*K;
ps(K) = 10*log10(255*255/mean2((nI-I).^2));
end
plot(ps);
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!