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

压缩解压

开发平台:

Matlab

  1. clear;
  2. X=imread('H:j.bmp');
  3. data=uint8(X);
  4. [zipped,info]=huffencode(data);
  5. unzipped=huffdecode(zipped,info);
  6. subplot(121);imshow(data);
  7. subplot(122);imshow(unzipped);
  8. erms=compare(data(:),unzipped(:))
  9. cr=info.ratio
  10. whos data unzipped zipped