📄 subdecom.m
字号:
% Y = subdecom(A,S,X)
% Do subband decomposition to gray-level image X. The
% lowpass and highpass filters of two-band FB are two
% columns of A (S) respectively. A is analysis FB;B is
% synthesis FB. Y will be the image after the
% reconstruction. This function can test the PR
% property of FB and Y is the coding limit.
% FB can be orthogonal or biorthogonal.
%%function Y = subdecom(A,B,X)
function [YLL,YLH,YHL,YHH] = subdecom(A,S,X)
[M,N] = size(X);
[MA,NA] = size(A);
[MB,NB] = size(S);
% ----------Row lowpass(L)---------------
for J = 1:M
L(J,:) = conv(A(:,1),X(J,:));
end
L = L(:,MA/2:N+MA/2-1);
for J = 1:M
YL(J,:) = dsample(L(J,:),2)';
end
% ----------Row highpass(H)--------------
for J = 1:M
H(J,:) = conv(A(:,2),X(J,:));
end
H = H(:,NA/2:M+NA/2-1);
for J = 1:M
YH(J,:) = dsample(H(J,:),2)';
end
%-----------L column lowpass----------
for J = 1:N/2
LL(:,J) = conv(A(:,1),YL(:,J));
end
LL = LL(MA/2:M+MA/2-1,:);
for J = 1:M/2
YLL(:,J) = dsample(LL(:,J),2);
end
%-----------L column highpass--------
for J = 1:N/2
LH(:,J) = conv(A(:,2),YL(:,J));
end
LH = LH(MA/2:M+MA/2-1,:);
for J = 1:M/2
YLH(:,J) = dsample(LH(:,J),2);
end
%-----------H column lowpass---------
for J = 1:N/2
HL(:,J) = conv(A(:,1),YH(:,J));
end
HL = HL(MA/2:M+MA/2-1,:);
for J = 1:M/2
YHL(:,J) = dsample(HL(:,J),2);
end
%-----------H column highpass--------
for J = 1:N/2
HH(:,J) = conv(A(:,2),YH(:,J));
end
HH = HH(MA/2:M+MA/2-1,:);
for J = 1:M/2
YHH(:,J) = dsample(HH(:,J),2);
end
%----------Analysis is Over---------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -