我正在尝试使用 10 点 daubechies 过滤器获取图像的第 4 级 DWT。(并自然地反转它!)
host = double(imread('lena512.bmp')); % Load image data
nLevel = 4; % Number of decompositions
cwA = cell(1,nLevel); % Approximation coefficients
cwH = cell(1,nLevel); % Horizontal detail coefficients
cwV = cell(1,nLevel); % Vertical detail coefficients
cwD = cell(1,nLevel); % Diagonal detail coefficients
% Do the DWT
myImage = host;
for iLevel = 1:nLevel,
[cwA{iLevel},cwH{iLevel},cwV{iLevel},cwD{iLevel}] = dwt2(myImage,'db10');
myImage = cwA{iLevel};
end
% Do the inverse DWT
fullRecon = cA{nLevel};
for iLevel = nLevel:-1:1
fullRecon = idwt2(fullRecon,cH{iLevel},cV{iLevel},cD{iLevel},'db10');
end
上面的代码不断给我错误:
???错误使用 ==> plus Matrix 维度必须一致。
==> idwt2 在 93 x = upsconv2(a,{Lo_R,Lo_R},sx,dwtEXTM,shift)+ ... % 近似值时出错。
==> 18 时的虚拟错误 fullRecon = idwt2(fullRecon,cH{iLevel},cV{iLevel},cD{iLevel},'db10');
我相信这是由于反向 dwt 做了一些时髦的事情。我也尝试更改 dwtmode 但没有帮助。我真的很乐意提供任何帮助。
PS:lena512.bmp只是lena的灰度图。它的尺寸是 512x512。
我对新想法持开放态度 =)