psnr.m
来自「PDTDFB toolbox The filter bank is des」· M 代码 · 共 18 行
M
18 行
function [gamma] = psnr(x,y)
% Takes two 8-bit IMAGES and computes peak-to-peak signal to noise ratio:
% gamma = 10 log (255^2/MSE)
% x and y must be the same dimension and may be 2D arrays or vectors.
sx = size(x);
sy = size(y);
if sx == sy
dd = x(:) - y(:);
gg = (dd' * dd)/prod(sx);
rr = 255^2./gg;
gamma = 10 * log10(rr);
else
fprintf ('\n Input image dimensions not consistent.');
gamma = NaN;
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?