Documentation |
Inverse nondecimated 2-D wavelet transform
C = indwt2(W,TYPE,N)
C = indwt2(W,TYPE)
C = indwt2(W,TYPE,N)
X = indwt2(W)
X
= indwt2(W,'a',0)
X
= indwt2(W,'ca',0)
indwt2 performs a multilevel nondecimated 2-D wavelet reconstruction starting from a multilevel nondecimated 2-D wavelet decomposition. You can also use indwt2 to extract coefficients from a multilevel nondecimated 2-D wavelet decomposition.
C = indwt2(W,TYPE,N) computes the reconstructed or the extracted components at level N of a nondecimated 2-D wavelet decomposition. N must be a positive integer less or equal to the level of the decomposition. The valid values for TYPE are:
A group of 2 chars 'xy', one per direction, with 'x' and 'y' in the set {'a','d','l','h'} or in the corresponding uppercase set {'A','D','L','H'}), where 'A' (or 'L') stands for low-pass filter and 'D' (or 'H') stands for high-pass.
The char 'd' (or 'h' or 'D' or 'H') specifies the sum of the components different from the low-pass one.
For extraction, the valid values for TYPE are the same as above prefixed by 'c' or 'C'.
See ndwt2 for more information about the decomposition structure W.
C = indwt2(W,TYPE) is equivalent to C = indwt2(W,TYPE,N) with N equal to the level of the decomposition.
X = indwt2(W), X = indwt2(W,'a',0) or X = indwt2(W,'ca',0) reconstructs the matrix X based on the nondecimated 2-D wavelet decomposition structure W.
% Load original image. load noiswom % Decompose X at level 3 using db1. W = ndwt2(X,3,'db1'); % Reconstruct approximations at levels 1 to 3. A = cell(1,3); for k=1:3, A{k} = indwt2(W,'aa',k); end % Plot original image at the top and approximations % at the bottom. figure; colormap(pink(255)) subplot(2,3,2);image(X); for k=1:3 subplot(2,3,k+3);image(A{k}); end
% Reconstruct detail at level 1. D = indwt2(W,'d',1); % Display reconstructed detail at level 1. figure; colormap(pink(255));imagesc(abs(D))
% Compute reconstructed approximation and detail at level 1. A1 = indwt2(W,'aa',1); D1 = indwt2(W,'d',1); % Check that X = A1 + D1. E1 = X-A1-D1; err1 = max(abs(E1(:))) err1 = 2.6645e-013 % Compute reconstructed approximation and detail at level 2. A2 = indwt2(W,'aa',2); D2 = indwt2(W,'d',2); % Check that X = A2 + D2. E2 = X-A2-D2; err2 = max(abs(E2(:))) err2 = 2.5668e-013