imgpsnr.m
来自「实现图象,可以直接运行,里面有示例图象,十分便捷的实现图象压缩」· M 代码 · 共 26 行
M
26 行
% Computes motion compensated image's PSNR%% Input% imgP : The original image % imgComp : The compensated image% n : the peak value possible of any pixel in the images%% Ouput% psnr : The motion compensated image's PSNR%% Written by Aroh Barjatyafunction psnr = imgPSNR(imgP, imgComp, n)[row col] = size(imgP);err = 0;for i = 1:row for j = 1:col err = err + (imgP(i,j) - imgComp(i,j))^2; endendmse = err / (row*col);psnr = 10*log10(n*n/mse);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?