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.)
matrix
or a list of matrices of storage mode complex.
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.
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.
# 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))