Gabor Filter¶
Basics¶
The Gabor filter is a tool used to analyze textures or to create features for a classifier. It operates by convolving the input image with a Gabor wavelet to detect specific frequency content in an image in a given direction within a localized region around the point or region of analysis.
A key aspect of the Gabor wavelet is that it is composed of two distinct structures which are multiplied with one another:
A Gaussian surface (a bell-shaped surface) that provides a smooth window. Its spread, its ellipticity and its orientation are influenced by the sigma (\(σ\)), the gamma (\(ɣ\)) and the theta (\(θ\)) parameters respectively.
A sinusoidal plane wave with a regular oscillation pattern. Its wavelength and phase are controlled by the lambda (\(λ\)) and psi (\(ψ\)) parameters respectively. Its orientation is determined by the theta (\(θ\)) parameter.
Parameter Descriptions¶
Sigma (\(σ\))¶
This parameter influences the spread of the Gaussian surface.
A larger \(σ\) value results in a wider spread, capturing larger structures in the image.
A smaller \(σ\) value results in a narrower spread.
Gamma (\(ɣ\))¶
This parameter specifies the ellipticity of the Gaussian surface. With \(ɣ=1\), the support is circular and as \(ɣ\) deviates from 1, the support becomes more elongated.
A larger \(ɣ\) value results in a more elongated Gaussian in a direction perpendicular to the stripes.
A smaller \(ɣ\) value results in a more elongated Gaussian in a direction parallel to the stripes.
Theta (\(θ\))¶
This parameter determines the orientation of both the Gaussian surface and the sinusoidal plane wave.
Lambda (\(λ\))¶
This parameter controls the wavelength of the sinusoidal plane wave.
Psi (\(ψ\))¶
This parameter shifts the sinusoidal wave in the direction perpendicular to the stripes. By adjusting psi, you can control the phase of the sinusoidal plane wave.
Usage¶
In eVision, use the method EasyImage::ConvolGabor .NET Python to apply a Gabor filter to an image.
This method takes several parameters including the source image, kernel size and Gabor parameters:
Use the method with or without a destination image.
If no destination image is provided, the source image is modified in-place.
You can use the method with a region of interest (ROI).
If an
ERegionobject is provided, the Gabor filter is only applied to the pixels within the region.
Set the parameter
normalizetoTrueto ensure that the sum of all the values in the Gabor kernel equals 1 by applying a uniform scaling factor to the kernel.If not specified, the default value is
False, meaning that no normalization is applied.
This visual arrangement displays input images interacting with distinct Gabor wavelets. Each tile reveals the filtered output and illustrates how adjusting the parameters influences the texture extraction during the image processing.
Gabor filter usage example: input images interacting with distinct Gabor wavelets.¶
See also
Code Snippets: Easy to understand, ready to copy code snippets.
Linear Filtering: Other convolution-based filters for noise reduction and edge enhancement.
Fourier Transform: Explicit frequency-domain filtering using the Fast Fourier Transform.