MSE and PSNR code for image
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!