dingfengfeng 发表于 2007-6-7 17:49

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

%%**针对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,);
title('原始图像');
axis square
=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,);
title('一次小波分解图像');
%% Two times discomposition
=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,)
title('二次小波分解图像');
%
% %% Three times discomposition
=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,)
title('三次小波分解图像');
下面怎么huffman编码?求高手解答.谢谢了.急!!~~
页: [1]
查看完整版本: 怎样对用小波3次压缩后的图象huffman编码?