资源简介
可以直接运行,我用的matlab2018a测试的。
代码片段和文件信息
% 此示意程序用DWT实现二维小波变换
% 编程人 沙威(Wei Sha) 安徽大学(Anhui University) ws108@ahu.edu.cn
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;clc;
T=256; % 图像维数
SUB_T=T/2; % 子图维数
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 1.调原始图像矩阵
load wbarb; % 下载图像
f=X; % 原始图像
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2.进行二维小波分解
l=wfilters(‘db10‘‘l‘); % db10(消失矩为10)低通分解滤波器冲击响应(长度为20)
L=T-length(l);
l_zeros=[lzeros(1L)]; % 矩阵行数与输入图像一致,为2的整数幂
h=wfilters(‘db10‘‘h‘); % db10(消失矩为10)高通分解滤波器冲击响应(长度为20)
h_zeros=[hzeros(1L)]; % 矩阵行数与输入图像一致,为2的整数幂
for i=1:T; % 列变换
row(1:SUB_Ti)=dyaddown( ifft( fft(l_zeros).*fft(f(:i)‘) ) ).‘; % 圆周卷积<->FFT
row(SUB_T+1:Ti)=dyaddown( ifft( fft(h_zeros).*fft(f(:i)‘) ) ).‘; % 圆周卷积<->FFT
end;
for j=1:T; % 行变换
line(j1:SUB_T)=dyaddown( ifft( fft(l_zeros).*fft(row(j:)) ) ); % 圆周卷积<->FFT
line(jSUB_T+1:T)=dyaddown( ifft( fft(h_zeros).*fft(row(j:)) ) ); % 圆周卷积<->FFT
end;
decompose_pic=line; % 分解矩阵
% 图像分为四块
lt_pic=decompose_pic(1:SUB_T1:SUB_T); % 在矩阵左上方为低频分量--fi(x)*fi(y)
rt_pic=decompose_pic(1:SUB_TSUB_T+1:T); % 矩阵右上为--fi(x)*psi(y)
lb_pic=decompose_pic(SUB_T+1:T1:SUB_T); % 矩阵左下为--psi(x)*fi(y)
rb_pic=decompose_pic(SUB_T+1:TSUB_T+1:T); % 右下方为高频分量--psi(x)*psi(y)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 3.分解结果显示
figure(1);
colormap(map);
subplot(211);
image(f); % 原始图像
title(‘original pic‘);
subplot(212);
image(abs(decompose_pic)); % 分解后图像
title(‘decomposed pic‘);
figure(2);
colormap(map);
subplot(221);
image(abs(lt_pic)); % 左上方为低频分量--fi(x)*fi(y)
title(‘\Phi(x)*\Phi(y)‘);
subplot(222);
image(abs(rt_pic)); % 矩阵右上为--fi(x)*psi(y)
title(‘\Phi(x)*\Psi(y)‘);
subplot(223);
image(abs(lb_pic)); % 矩阵左下为--psi(x)*fi(y)
title(‘\Psi(x)*\Phi(y)‘);
subplot(224);
image(abs(rb_pic)); % 右下方为高频分量--psi(x)*psi(y)
title(‘\Psi(x)*\Psi(y)‘);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 5.重构源图像及结果显示
% construct_pic=decompose_matrix‘*decompose_pic*decompose_matrix;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
l_re=l_zeros(end:-1:1); % 重构低通滤波
l_r=circshift(l_re‘1)‘; % 位置调整
h_re=h_zeros(end:-1:1); % 重构高通滤波
h_r=circshift(h_re‘1)‘; % 位置调整
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
top_pic=[lt_picrt_pic]; % 图像上半部分
t=0;
for i=1:T; % 行插值低频
if (mod(i2)==0)
topll(i:)=top_pic(t:); % 偶数行保持
else
t=t+1;
topll(i:)=zeros(1T); % 奇数行为零
end
end;
for i=1:T; % 列变换
topcl_re(:i)=ifft( fft(l_r).*fft(topll(:i)‘) )‘; % 圆周卷积<->FFT
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bottom_pic=[lb_picrb_pic]; % 图像下半部分
t=0;
for i=1
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1142 2018-09-18 16:33 DWT_1D.zip
文件 5054 2007-06-12 10:46 DWT_2D.m
文件 1599 2018-09-18 16:31 DWT_2D.zip
- 上一篇:燃料电池极化曲线模型
- 下一篇:SVPWM模型的simuli
nk仿真
相关资源
- 压缩感知somp代码
- 压缩感知去噪
- 多维压缩感知中三维图像处理Matlab
- 压缩感知Matlab-代码与文档-l1magic-1.1
- 压缩感知的图像去噪
- 压缩感知稀疏度自适应匹配追踪算法
- 压缩感知MP重构算法的matlab实现
- 压缩感知重构算法基追踪(BP)
- Matlab单像素成像算法比较
- 图像稀疏表示matlab193095
- 压缩感知测量矩阵产生
- MATLAB用压缩感知恢复一维信号
- 压缩感知 贪婪追踪算法成功率的比较
- 压缩感知小波变换synsq_toolboxmatlab代码
- 压缩感知代码,matlab,l1qc_logbarrier
- 压缩感知off grid代码论文见2013
- 压缩感知 OMP重构一维二维信号matlab仿
- 压缩感知OMP算法代码
- 压缩感知之基追踪法BP
- lws压缩感知matlab 代码
- 神经电压缩感知matlab
- 基于压缩感知的信道估计
- 压缩感知离散余弦变换基-小波基MAT
- 压缩感知块稀疏BOMP算法
- 压缩感知图像MATLAB代码美国乔治亚理
- 压缩感知DOA估计
- 大牛写的压缩感知的OMP算法绝对简单
- 压缩感知之分段正交匹配追踪法StOM
- 压缩感知之迭代硬阈值法IHT可直接运
- 分布式压缩感知边信息提取的matlab代
评论
共有 条评论