MSE and PSNR code for image
18 ビュー (過去 30 日間)
古いコメントを表示
I'm calculating MSE and PSNR values for an image. Following is the code for it. Can you explain this code ? It seems quite complicated. I think m, n, d are height, width, length respectively.
a=imread('colorlable.jpg');
[m,n,d]=size(a);
kmax=floor((m*n)/(m+n+1));
da=double(a);
U=zeros(m,m);S=zeros(m,n);V=zeros(n,n);e=zeros(kmax,d);cr=zeros(kmax,1);rmse=zeros(kmax,d);
for i=1:d
[U(:,:,i),S(:,:,i),V(:,:,i)]=svd(da(:,:,i));
end
for k=1:kmax
ca=zeros(m,n,d);
MSE=m*n/(k*(m+n+1));
fprintf('MSE value at %f.\n',MSE);
SNR =(10*log10((sum(m.^2)))/MSE);
fprintf('PSNR value at %4f.\n',SNR);
end
0 件のコメント
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!