⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 erzhifenjie.m

📁 matlab写的lzw和huffman的编码
💻 M
字号:
tu=imread('11.JPG');
tu=rgb2gray(tu);
tu=double(tu);
[a,b]=size(tu);
c=zeros(a,b,8);
for i1=1:a
    for i2=1:b
        y=0;
        s=tu(i1,i2);
        i=1;    
      while  s~=1 & s~=0
        y=mod(s,2);
        c(i1,i2,i)=y;
        s=fix(s/2);
        i=i+1;
      end
      c(i1,i2,i)=s;
  end  
end
figure(1),subplot(221),imshow(c(:,:,1)) ,title('B0层')
subplot(222),imshow(c(:,:,2)) ,title('B1层') 
subplot(223),imshow(c(:,:,3))  ,title('B2层')
subplot(224),imshow(c(:,:,4))  ,title('B3层')
figure(2),subplot(221),imshow(c(:,:,5))  ,title('B4层')
subplot(222),imshow(c(:,:,6))  ,title('B5层')
subplot(223),imshow(c(:,:,7))  ,title('B6层')
subplot(224),imshow(c(:,:,8))  ,title('B7层')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -