Discrete stationary wavelet transform 2-D
SWC = swt2(X,N,'
[A,H,V,D] = swt2(X,N,'
SWC = swt2(X,N,Lo_D,Hi_D)
[A,H,V,D] = swt2(X,N,Lo_D,Hi_D)
swt2 performs a multilevel
2-D stationary wavelet decomposition using either a specific orthogonal
wfilters for more information) or specific
orthogonal wavelet decomposition filters.
SWC = swt2(X,N,' or
= swt2(X,N,' compute
the stationary wavelet decomposition of the matrix
N must be a strictly positive integer (see
wmaxlev for more information), and 2N must
[A,H,V,D] are 3-D arrays, which contain
the output matrix
A(:,:,i) contains the coefficients
of approximation of level
The output matrices
the coefficients of details of level
vertical, and diagonal):
SWC = [H(:,:,1:N) ; V(:,:,1:N) ; D(:,:,1:N) ; A(:,:,N)]
SWC = swt2(X,N,Lo_D,Hi_D) or
= swt2(X,N,Lo_D,Hi_D), computes the stationary wavelet
decomposition as in the previous syntax, given these filters as input:
Lo_D is the decomposition low-pass
Hi_D is the decomposition high-pass
Hi_D must be
the same length.
% Load original image. load nbarb1; % Image coding. nbcol = size(map,1); cod_X = wcodemat(X,nbcol); % Visualize the original image. subplot(221) image(cod_X) title('Original image'); colormap(map) % Perform SWT decomposition % of X at level 3 using sym4. [ca,chd,cvd,cdd] = swt2(X,3,'sym4'); % Visualize the decomposition. for k = 1:3 % Images coding for level k. cod_ca = wcodemat(ca(:,:,k),nbcol); cod_chd = wcodemat(chd(:,:,k),nbcol); cod_cvd = wcodemat(cvd(:,:,k),nbcol); cod_cdd = wcodemat(cdd(:,:,k),nbcol); decl = [cod_ca,cod_chd;cod_cvd,cod_cdd]; % Visualize the coefficients of the decomposition % at level k. subplot(2,2,k+1) image(decl) title(['SWT dec.: approx. ', ... 'and det. coefs (lev. ',num2str(k),')']); colormap(map) end % Editing some graphical properties, % the following figure is generated.
When X represents an indexed image, X is an
and the output arrays SWC or cA,cH,cV, and cD are
When X represents a truecolor image, it becomes an
array. This array is an
array, where each
represents a red, green, or blue color plane concatenated along the
third dimension. The output arrays SWC or cA,cH,cV, and cD are
For images, an algorithm similar to the one-dimensional case is possible for two-dimensional wavelets and scaling functions obtained from one-dimensional ones by tensor product.
This kind of two-dimensional SWT leads to a decomposition of approximation coefficients at levelj in four components: the approximation at level j+1, and the details in three orientations (horizontal, vertical, and diagonal).
The following chart describes the basic decomposition step for images:
Nason, G.P.; B.W. Silverman (1995), "The stationary wavelet transform and some statistical applications," Lecture Notes in Statistics, 103, pp. 281–299.
Coifman, R.R.; Donoho, D.L. (1995), "Translation invariant de-noising," Lecture Notes in Statistics, 103, pp. 125–150.
Pesquet, J.C.; H. Krim, H. Carfatan (1996), "Time-invariant orthonormal wavelet representations," IEEE Trans. Sign. Proc., vol. 44, 8, pp. 1964–1970.