jpeg.asv
上传用户:mgf822
上传日期:2022-06-06
资源大小:51k
文件大小:0k
源码类别:

压缩解压

开发平台:

Matlab

  1. clear all;
  2. x=imread('H:lena.bmp');
  3. figure(1);
  4. subplot(121);
  5. imshow(x);
  6. Y=jpegencode(x,5);
  7. X=jpegdecode(Y);
  8. subplot(122);
  9. imshow(X);
  10. e=double(x)-double(X);
  11. [m,n]=size(e);
  12. erms=sqrt(sum(e(:).^2)/(m*n))
  13. ave=mean(x(:));
  14. x1=x.^2;
  15. cs1=sum(x1(:));
  16. x1=(x-X).^2;
  17. cd1=sum(x1(:));
  18. snr=10*log10(cs1/cd1)
  19. % figure(1);imshow(X);
  20. % localmax=imread('H:max.bmp');
  21. % Last=X+localmax;
  22. % figure(2);imshow(Last);