📄 linbwt2.m
字号:
function X = linbwt2(X, Level)
%LINBWT2 2D linear binary wavelet transform.
% Y = LINBWT2(X,L) computes the L level decomposition of binary
% image X using a 2D linear binary wavelet wavelet transform. The
% transform coefficients are also binary. The image dimensions
% must be divisible by 2^L.
%
% LINBWT2(X,-L) is the inverse transform, reversing L levels.
%
% Example:
% Y = linbwt2(X,3); % Perform 3 levels of decomposition on X
% R = linbwt2(Y,-3); % Recover X from Y
%
% See also LINBWT, MORPHBWT2.
% Pascal Getreuer 2005
if nargin < 2, error('Not enough input arguments.'); end
if rem(size(X),pow2(abs(Level))), error('Invalid input size.'); end
if Level > 0
for k = 1:Level
N = size(X)*pow2(1-k);
X(1:N(1),1:N(2)) = linbwt(linbwt(X(1:N(1),1:N(2)),1,1),1,2);
end
elseif Level < 0
for k = Level:-1
N = size(X)*pow2(k+1);
X(1:N(1),1:N(2)) = linbwt(linbwt(X(1:N(1),1:N(2)),-1,2),-1,1);
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -