声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1543|回复: 0

[综合] 怎样对用小波3次压缩后的图象huffman编码?

[复制链接]
发表于 2007-6-7 17:49 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
%%**  针对woman图像进行三次二维离散小波分解
%%**  针对cameraman.tif图像进行三次二维离散小波分解
%%**  针对米miss.bmp图像进行三次二维离散小波分解
%%**  by Cheng Hao , 2007.4.21
clc
clear all
close all
load woman;
% X=imread('cameraman.tif');
% X=imread('miss01.bmp');
% X=im2double(X)*256;
figure(1);
imshow(X,[1,256]);
title('原始图像');
axis square
[cA1,cH1,cV1,cD1]=dwt2(X,'db2');
%display the one time discomposition images on a single figure
c1=[cod_cA1(1:128,1:128),cod_cH1(1:128,1:128);...
    cod_cV1(1:128,1:128),cod_cD1(1:128,1:128)];
figure
imshow(c1,[1,256]);
title('一次小波分解图像');
%% Two times discomposition
[ccA1,ccH1,ccV1,ccD1]=dwt2(cod_cA1(1:128,1:128),'db2');
cod_ccA1=wcodemat(ccA1,nbcol);
cod_ccH1=wcodemat(ccH1,nbcol);
cod_ccV1=wcodemat(ccV1,nbcol);
cod_ccD1=wcodemat(ccD1,nbcol);
%%display the two times discomposition images on a single figure
cc1=[cod_ccA1(1:64,1:64),cod_ccH1(1:64,1:64);...
    cod_ccV1(1:64,1:64),cod_ccD1(1:64,1:64)];
c1=[cc1,cod_cH1(1:128,1:128);...
    cod_cV1(1:128,1:128),cod_cD1(1:128,1:128)];
figure
imshow(c1,[1,256])
title('二次小波分解图像');
%
% %% Three times discomposition
[cccA1,cccH1,cccV1,cccD1]=dwt2(cod_ccA1(1:64,1:64),'db2');
cod_cccA1=wcodemat(cccA1,nbcol);
cod_cccH1=wcodemat(cccH1,nbcol);
cod_cccV1=wcodemat(cccV1,nbcol);
cod_cccD1=wcodemat(cccD1,nbcol);
%display the three times discomposition images on a single figure
ccc1=[cod_cccA1(1:32,1:32),cod_cccH1(1:32,1:32);...
    cod_cccV1(1:32,1:32),cod_cccD1(1:32,1:32)];
cc1=[ccc1,cod_ccH1(1:64,1:64);...
    cod_ccV1(1:64,1:64),cod_ccD1(1:64,1:64)];
c1=[cc1,cod_cH1(1:128,1:128);...
    cod_cV1(1:128,1:128),cod_cD1(1:128,1:128)];
figure
imshow(c1,[1,256])
title('三次小波分解图像');
下面怎么huffman编码?求高手解答.谢谢了.急!!~~
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-12-2 17:30 , Processed in 0.052290 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表