SNR.m
上传用户:cxsjwj
上传日期:2022-08-09
资源大小:34k
文件大小:0k
- function psnr = SNR(imgP, imgComp, m,n)
- [row col] = size(imgP);
- err = 0;
- for i = 1:row
- for j = 1:col
- err = err + (imgP(i,j) - imgComp(i,j))^2;
- end
- end
- mse = err / (row*col);
- psnr = 10*log10(m*n/mse);