资源简介
本代码,可用于对输入信号,进行任意指定小波类型、任意指定层数的小波分解。
代码片段和文件信息
function [I_W S] = func_DWT(I level Lo_D Hi_D);
%通过这个函数将I进行小波分解,并将分解后的一维向量转换为矩阵形式
% Matlab implementation of SPIHT (without Arithmatic coding stage)
%
% Wavelet decomposition
%
% input: I : input image
% level : wavelet decomposition level
% Lo_D : low-pass decomposition filter
% Hi_D : high-pass decomposition filter
%
% output: I_W : decomposed image vector
% S : corresponding bookkeeping matrix
%
% please refer wavedec2 function to see more
%
% Jing Tian
% Contact me : scuteejtian@hotmail.com
% This program is part of my undergraduate project in GuangZhou P. R. China.
% April - July 1999
[CS] = func_Mywavedec2(IlevelLo_DHi_D);
S(:3) = S(:1).*S(:2); % dim of detail coef nmatrices 求低频和每个尺度中高频的元素个数
%st=S(13)+S(23)*3+S(33)*3;%%%%对前两层加密
%C(1:st)=0;
L = length(S); %a求S的列数
I_W = zeros(S(L1)S(L2));%设一个与原图像大小相同的全零矩阵
% approx part
I_W( 1:S(11) 1:S(12) ) = reshape(C(1:S(13))S(11:2)); %将LL层从C中还原为S(11)*S(22)的矩阵
for k = 2 : L-1 %%%%%%%%%%%%%%%%%%%%%%将C向量中还原出HLHHLH 矩阵
rows = [sum(S(1:k-11))+1:sum(S(1:k1))];
columns = [sum(S(1:k-12))+1:sum(S(1:k2))];
% horizontal part
c_start = S(13) + 3*sum(S(2:k-13)) + 1;
c_stop = S(13) + 3*sum(S(2:k-13)) + S(k3);
I_W( 1:S(k1) columns ) = reshape( C(c_start:c_stop) S(k1:2) );
% vertical part
c_start = S(13) + 3*sum(S(2:k-13)) + S(k3) + 1;
c_stop = S(13) + 3*sum(S(2:k-13)) + 2*S(k3);
I_W( rows 1:S(k2) ) = reshape( C(c_start:c_stop) S(k1:2) );
% diagonal part
c_start = S(13) + 3*sum(S(2:k-13)) + 2*S(k3) + 1;
c_stop = S(13) + 3*sum(S(2:k3));
I_W( rows columns ) = reshape( C(c_start:c_stop) S(k1:2) );
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1883 2015-05-31 13:33 func_DWT.m
文件 1683 2015-05-31 13:33 func_Myappcoef2.m
- 上一篇:hex转coe工具
- 下一篇:特征工程-特征选择思维导图
评论
共有 条评论