2D Gabor Wavelet Transform

DESCRIPTION:

Calculates the 2D Gabor wavelet transform of an image.

USAGE:

wavGabor( in.image, nlevels = 1, nvoices = 1, nangles = 1,
          angle.init = pi/2, angle.step = 0., sigma = 1.,
          aspect = 0.5, bandwidth = 1.,
          frequency =( sqrt( 2*log(2) ) ) * ( (2^bandwidth + 1) /
          (2^bandwidth - 1 ) ) / ( sigma * aspect ),
          step = 0.8, boundary = "zero", downsample = TRUE)

REQUIRED ARGUMENTS:

in.image
a matrix containing the image to process.

OPTIONAL ARGUMENTS:

nlevels
the number of dyadic levels to compute. It must be nlevels < log(min(dim(in.image)), base=2).
nvoices
the number of voices per level to compute. Specifying this argument greater than 1 allows for fractionally dilated wavelets.
nangles
the number of rotation angles of the kernel per voice to compute.
angle.init
the angle, measured in radians, at which to start computing the rotation angles.
angle.step
the angle, measured in radians, separating two consecutive rotations of the kernel. The range of possible angle values is (-pi/2, -pi/2]. The first rotation angle is determined by parameter angle.init. All other angles are computed so that angle[n] = angle.init + n * angle.step. If any of the angles are outside the range (-pi/2,pi/2], an error occurs.
sigma
the standard deviation in the Gaussian part of the Gabor wavelet.
aspect
the aspect ratio of the Gaussian part of the Gabor wavelet.
bandwidth
the bandwidth of the Fourier transform of the Gabor wavelet, measured in octaves. Typical values are 1 and 1.5. if both the bandwidth and the frequency are specified by the user, the frequency takes precedence and the bandwidth attribute of the result is calculated from it, and may be different from the one provided. The computed value of the bandwidth (B), is defined in terms of the frequency ($\omega$), standard deviation (\$sigma$) and aspect ratio ($\lambda$): $B = log_{2}(\frac{\sigma \lambda \omega + \sqrt(2 ln2)} {\sigma \lambda \omega - \sqrt(2 ln2)})$
frequency
the frequency in the complex exponential part of the Gabor wavelet. The frequency($\omega) defaults to a value that depends on the bandwidth (B), the standard deviation ($\sigma$) and the aspect ratio (\$lambda$): $\omega = \frac{K}{\omega \lambda}$, where K is a defined as $K = \sqrt{2 ln 2}(\frac{2^{B} + 1}{2^{B} - 1})$.
step
the step size (sampling interval) between successive pixels in the Gabor wavelet.
boundary
one of "zero", "periodic", "reflect", or "continue", giving the boundary conditions to use for convolution of the wavelet with the image.
downsample
a logical value, TRUE for convolution with downsampling, FALSE for convolution without downsampling. If TRUE, the resultant matrices will have dyadically decreasing dimensions corresponding to each level. The number of voices and the number of angles do not affect the size of the wavelet coefficient matrix for a fixed level.

VALUE:

A list of complex matrices, containing the wavelet coefficients at each level, voice, and angle. The list is ordered so that first the decomposition level and voice are fixed, and the rotation angle varies, then the voice changes, and then the decomposition level.

DETAILS:

The Gabor wavelets are not orthonormal, but may form a frame if the decomposition parameters are chosen appropriately. For the Gabor wavelets to form a frame, the step size and the frequency must be such that step * frequency <= 2pi. However, for the frame to be tight, it is usually necessary to have step * frequency << 2pi. For a fixed frequency, this can be achieved by lowering the step parameter. In turn, this leads to smoother wavelets, at the expense of a smaller wavelet size (with all other parameters kept constant). Another way to make the frame tighter, and thus approximate an orthogonal base, is to oversample that is to use a larger number of rotations, voices, and levels than strictly necessary. It is possible to reconstruct the original matrix from a Gabor wavelet decomposition that forms a tight frame by simply adding the wavelets themselves, scaled by the coefficients of the decomposition and by a factor proportional to the frame bounds. For details, see the references.

REFERENCES:

Tai Sing Lee, ``Image Representation Using 2D Gabor Wavelets'', IEEE Trans. Pattern Analysis and Machine Intelligence, vol. 18, no. 10, Oct. 1996.

Bovik, A. C. and Clark, M. and Geisler, W. ``Multichannel Texture Analysis Using Localized Spatial Filters'', IEEE Trans. Pattern Analysis and Machine Intelligence, vol. 12, no. 1, Jan. 1990.

Daubechies, I. Ten Lectures in Wavelets, SIAM, 1992.

SEE ALSO:

EXAMPLES:

# 2 levels, 3 voices, 3 angles of rotation
# starting a pi/4, separated by pi/8
out1 <- wavGabor(lena, nlevels=2, nvoices=3, nangles=3, angle.init=pi/4, angle.step=pi/8)

# examine attributes of wavelet transform
attributes(out1)

# examine the wavelet coefficients of the second level,
# first voice, third angle
out2 <- wavGaborExtract(out1, level=2, voice=1, angle=1)
image(Re(out2))
image(Im(out2))
# 5 angles of rotation, starting at pi/2, separated by pi/10
# no downsampling, and continuation boundary condition for convolution
out3 <- wavGabor(lena, nangles=5, angle.step=pi/10, boundary="continue", downsample=FALSE)

# examine wavelet coefficients at second angle of rotation
out4 <- wavGaborExtract(out3, level=1, voice=1, angle=2)
image(Re(out4))
image(Im(out4))