exRLE.m
Upload User: hwtw888
Upload Date: 2016-03-15
Package Size: 177k
Code Size: 0k
Development Platform:

Matlab

  1. clear all;
  2. I = imread('cameraman.tif');
  3. I = im2bw(I, 0.4);
  4. [zipped, info] = RLEncode(I);
  5. unzipped = RLEdecode(zipped, info);
  6. %显示原始图像和经编解码后的图像,显示压缩比,并计算均方根误差得erms=0,
  7. %表示RLE是无失真编码。
  8. I2 = logical(unzipped);
  9. subplot(121);imshow(I);
  10. subplot(122);imshow(I2);
  11. erms = compare(I, I2)
  12. cr = info.ratio
  13. whos I unzipped zipped