Create 2D Gabor wavelets.

DESCRIPTION:

Creates a 2D Gabor wavelet or a list of 2D Gabor wavelets.

USAGE:

wavGaborWavelet( 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, nrow = NULL, ncol = NULL, norm.factor = 1.)

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. If computing only one Gabor wavelet, it is the angle of orientation of that particular wavelet.
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 (columns/rows) 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.
nrow
the number of rows of the wavelet matrix if computing a single specific wavelet.
ncol
the number of columns of the wavelet matrix if computing a single specific wavelet.

VALUE:

a single matrix or a list of matrices of storage mode complex.

DETAILS:

This function is generates a single 2D Gabor wavelet of dimensions and orientation specified by the user, or a list of Gabor wavelets that correspond to the wavelets used in the 2D Gabor wavelet transform which uses the same parameters( sigma, aspect, number of levels etc.). To generate a single matrix, specify the number of rows and columns, and the function will ignore the nlevels, nvoices, nangles and angle.offset parameters. To generate a list of wavelets related to each other, do not provide the nrow and ncol parameters, and the function will ignore them and the angle parameter.

The 2D Gabor wavelet consists of a two-dimensional Gaussian envelope, rotated by an angle with respect to the row (y) and column (x) directions, and modulated by a complex exponential along the column direction: $G(x,y)=\frac{1}{\sqrt{\pi \lambda \sigma^{2}}}e^{\frac{-(x/\lambda)^{2}+y^{2}}{2\sigma^{2}}}e^{-j\omega_{o} x}$, where $\lambda$ is the aspect ratio of the elliptical Gaussian envelope, sigma the standard deviation, and omega the frequency, measured in radians per matrix, in the complex exponential.

The coordinates x and y are obtained by rotating the (x,y) axis by an angle, so that the resulting modulated Gaussian is rotated as well by the same angle: $x = X \cos(\theta) + Y \sin(\theta)$ $y = -X \sin(\theta) + Y \cos(\theta)$

This function shifts the values of the real part of the Gabor wavelet so that their sum is zero. This is required for the Gabor function to be an admissible wavelet. The imaginary part is always antisymmetric around the center of the Gaussian, so it always adds to zero. For the case of a list of wavelets, their dimensions are always odd.

This function is useful for inspecting the wavelets used in a Gabor wavelet composition, and for generating plots of Gabor wavelets.

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 <- wavGaborWavelet(nlevels=2, nvoices=3, nangles=3, angle.init=pi/4, angle.step=pi/8)

# examine the wavelet at second level, third voice, third angle
out2 <- wavGaborExtract(out1, level=1, voice=3, angle=3)
trellis.device()
persp(Re(out2))
#just one custom-made 2D Gabor wavelet, at default orientation pi/2
out3 <- wavGaborWavelet(nrow=21, ncol=17, sigma=1.2, frequency=pi/3)
trellis.device()
persp(Im(out3))