Name
owave2 Computes the orthogonal wavelet transform of an image
Command Synopsis
owave2 [-r NLevel] [-h HaarNLevel] [-e EdgeMode] [-p PrecondMode] [-i] [-n FilterNorm] Image WavTrans ImpulseResponse [EdgeIR ]
-r NLevel : Number of levels (default 1)
-h HaarNLevel : Continue decomposition with Haar filter until level HaarNLevel
-e EdgeMode : Edge processing mode (0/1/2/3, default 3)
-p PrecondMode : Edge preconditionning mode (0/1/2, default 0)
-i : Invertible transform
-n FilterNorm : Filter taps normalization. 0: no normalization, 1: sum equal to 1.0, 2: squares sum equal to 1.0 (default)
Image : Input image (fimage)
WavTrans : Output wavelet transform of Image (wtrans2d)
ImpulseResponse : Impulse response of inner filters (fsignal)
EdgeIR : Impulse reponses of edge and preconditionning filters (fimage)
Function Summary
void owave2 (NumRec , Haar , Edge , Precond , Inverse , FilterNorm , Image , Output , Ri , Edge_Ri )
int *NumRec ;
int *Haar ;
int *Edge ;
int *Precond ;
int *Inverse ;
int *FilterNorm ;
Fimage Image ;
Wtrans2d Output ;
Fsignal Ri ;
Fimage Edge_Ri ;
Description
owave2 computes the two-dimensional discrete wavelet transform of the floating point image stored in the file Image, according to the pyramidal algorithm of S. Mallat [Mal89].
This module is a generalisation to the 2D case of the owave1 module. This generalisation is done in the same way as in [Mal89], i.e. owave2 performs a semi-separable transform. More precisely, it can be decomposed at each level in two one-level and one-dimensional wavelet transforms applied successively on the lines and on the columns of the image (at level 1) or of the average sub-image (at level 2, 3, ...). It corresponds to a separable multiresolution analysis and a semi-separable wavelet basis on L^{2}(IR^{2}) (here semi-separable means that each 2D wavelet is the tensor product of two 1D wavelets or scaling functions, but that the whole 2D basis is not the tensor product of two 1D bases). The one-dimensional algorithm is the one that is implemented in owave1, and the reader is refered to the documentation of this module for its description. Here, only the multidimensional aspect of the algorithm is developed.
Suppose that {V_{j}} is a multiresolution analysis on L^{2}(IR). Then V_{j} = V_{j} V_{j} is a multiresolution analysis on L^{2}(IR^{2}). If is the scaling function associated to V_{j} then (x, y) = (x)(y) is the scaling function associated to V_{j}, and {2^{-j}(2^{-j}. - k, 2^{-j}. - l )}_{k, l Z} is an orthonormal basis of V_{j}.
As for the one-dimensional case, the projection P_{Vj}f of a function f of L^{2}(IR^{2}) onto V_{j} represents the approximation of f at scale 2^{j}. Here again the coordinates of f in the basis {2^{-j}(2^{-j}. - k, 2^{-j}. - l )}_{k, l Z} are noted A_{j}[k, l]. A_{j} can be considered as an average of the original image at resolution 2^{j}.
As in one-dimensional case, the space of details W_{j} is the orthogonal complement of V_{j} in V_{j-1}. Now it can be decomposed as a direct sum of three orthogonal subspaces W^{1}_{j}, W^{2}_{j}, and W^{3}_{j}. Each of these subspaces can be generated by a mother wavelet :
The coordinates of the function f in each of these basis are noted respectively D^{1}_{j}[k, l], D^{2}_{j}[k, l], and D^{3}_{j}[k, l]. D^{1}_{j}[k, l] represents the details of f in the horizontal direction (it is an average in the vertical direction). D^{2}_{j}[k, l] represents the details in the vertical direction (it is an average in the horizontal direction). D^{3}_{j}[k, l] represents details in both directions, and in some sense the corners in the image.
If f is in V_{0} and its coordinates {A_{0}[k, l]}_{0 k K-1, 0 l L-1} are stored in the file Image, then owave2 computes the wavelet representation of f, i.e. the sequence of details and average 2D signals or ``sub-images'' D^{1}_{1}, D^{1}_{2},..., D^{1}_{J}, D^{2}_{1},...D^{2}_{J}, D^{3}_{1},..., D^{3}_{J}, A_{J}, where J is a positive integer. This is done recursively, at each step the one level one-dimensional wavelet transform is applied to each line of A_{j}, resulting in two sub-images. Then the one level one-dimensional wavelet transform is applied to each sub-images' column.
The different methods for computing the edge coefficients are the same as for the univariate case (see owave1), unless the dimensions of the image are not multiples of 2^{J} and the invertible mode (option -i) is not activated. Suppose that at some level j of the decomposition, the dimensions of the average are not even, say for instance that the number of columns is 2n + 1 for some integer n. Then for the 1D wavelet transforms along the lines, only the first 2n coefficients are used, and the last coefficients are multiplied by a constant (equal to the sum of the I.R. coefficients) and concatenated to the resulting average subsignals at level j + 1. Thus the resulting subimages A_{j+1} and D^{1}_{j+1} have n + 1 columns, while D^{2}_{j+1} and D^{3}_{j+1} have n columns.
Because of the down-sampling, the size of the sub-images is divided by two in both directions at each step. So the total size of the sub-image is divided by four. As a consequence, if the problem of edges is omitted, the size of the wavelet decomposition, obtained by adding the size of all the sub-images composing it, is equal to the size of the original sub-image. Moreover the parameter J is upperbounded.
The complexity of the algorithm is 2(2 - 2^{-J+1})N dx dy multiplications and additions, where dx and dy are respectively the number of columns and the number of lines in the original image.
The resulting sub-images A_{J}, D^{1}_{1}, D^{1}_{2},..., D^{1}_{J}, D^{2}_{1}, D^{2}_{2},..., D^{2}_{J}, and D^{3}_{1}, D^{3}_{2},..., D^{3}_{J} are stored in files having all the same prefix Wavtrans. The name of the file is prefix_j_A.wtrans2d for A_{j} and prefix_j_D.wtrans2d for D_{j}.
The coefficients h_{k} of the filter's impulse response are read in the file ImpulseResponse. The coefficients of the filter's impulse response for computing the edge coefficients are read in the file EdgeIR.
See Also
Version 1.3
Last Modification date : Thu Jan 31 15:08:21 2002
Author
Jean-Pierre D'Ales