Clever Geek Handbook
📜 ⬆️ ⬇️

Gabor filter

The Gabor filter is a linear electronic filter whose impulse response is determined as a harmonic function multiplied by Gaussians . In digital image processing, this filter is used to recognize the boundaries of objects.

Linear electronic filters
Butterworth Filter
Chebyshev filter
Elliptical filter
Bessel filter
Gauss Filter
Legendre Filter
Gabor filter
An example of a two-dimensional filter Gabor

Due to the property of matching the convolution in the time domain to multiplication in the frequency domain, the Fourier transform of the impulse response of a Gabor filter is a convolution of the Fourier transforms of the harmonic function and the Gaussian.

g(x,y;λ,θ,ψ,σ,γ)=exp⁡(-x′2+γ2y′22σ2)cos⁡(2πx′λ+ψ){\ displaystyle g (x, y; \ lambda, \ theta, \ psi, \ sigma, \ gamma) = \ exp (- {\ frac {x '^ {2} + \ gamma ^ {2} y' ^ { 2}} {2 \ sigma ^ {2}}}) \ cos (2 \ pi {\ frac {x '} {\ lambda}} + \ psi)} g (x, y; \ lambda, \ theta, \ psi, \ sigma, \ gamma) = \ exp (- {\ frac {x '^ {2} + \ gamma ^ {2} y' ^ {2}} {2 \ sigma ^ {2}}}) \ cos (2 \ pi {\ frac {x '} {\ lambda}} + \ psi)

Where

x′=xcos⁡θ+ysin⁡θ{\ displaystyle x '= x \ cos \ theta + y \ sin \ theta} {\ displaystyle x '= x \ cos \ theta + y \ sin \ theta}

and

y′=-xsin⁡θ+ycos⁡θ{\ displaystyle y '= - x \ sin \ theta + y \ cos \ theta} {\ displaystyle y '= - x \ sin \ theta + y \ cos \ theta}

In this equationλ {\ displaystyle \ lambda} \ lambda is the wavelength of the cosine multiplier,θ {\ displaystyle \ theta} \ theta determines the orientation of the normal of parallel bands of the Gabor function in degrees,ψ {\ displaystyle \ psi} \ psi - phase shift in degrees andγ {\ displaystyle \ gamma} \ gamma - compression ratio, which characterizes the ellipticity of the Gabor function.

Here is an example of the implementation of the Gabor filter for the Matlab package:

  function    gb =    gabor_fn ( sigma_x, theta, lambda, psi, gamma ) 

 sz_x = fix ( 6 * sigma_x );  % based on the value of sigma got the size of the core
 sz_x = sz_x - mod ( sz_x , 2 ) + 1 ;  % if even - make odd

 sz_y = fix ( 6 * sigma_x / gamma );  % based on the value of sigma and coefficient  compression got the second core size
 sz_y = sz_y - mod ( sz_y , 2 ) + 1 ;  % if even - make odd

 [ x y ] = meshgrid ( - fix ( sz_x / 2 ): fix ( sz_x / 2 ), fix ( - sz_y / 2 ): fix ( sz_y / 2 ));  % asked to set definitions

 % Rotate
 x_theta = x * cos ( theta ) + y * sin ( theta );
 y_theta = - x * sin ( theta ) + y * cos ( theta );

 gb = exp ( - . 5 * ( x_theta . ^ 2 / sigma_x ^ 2 + gamma ^ 2 * y_theta . ^ 2 / sigma_x ^ 2 )) * cos ( 2 * pi * x_theta ./ lambda + psi );  % core

Gabor filters are directly related to Gabor wavelets , since they can be constructed by a series of contractions and rotations. The Gabor space (filter convolution with a signal) is often used in various image processing applications, in particular, for iris recognition in biometric security systems and in automated access control systems based on fingerprint recognition.

Gabor's one-dimensional filter construction algorithm

 
Cosine, exponential and their composition in Gabor function

To build a one-dimensional Gabor filter, the formula is applied:
G(x)=exp⁡(-x22σ2)cos⁡(2πθx){\ displaystyle G (x) = \ exp \ left (- {\ frac {x ^ {2}} {2 \ sigma ^ {2}}} \ right) \ cos (2 \ pi \ theta x)}   where:

  • σ{\ displaystyle \ sigma}   - standard deviation of the Gaussian core, which determines the amplitude of the function;
  • θ{\ displaystyle \ theta}   - oscillation frequency, defined asθ=oneT {\ displaystyle \ theta = {\ frac {1} {T}}}   where:
  • T{\ displaystyle T}   - function periodcos⁡(2πθx) {\ displaystyle \ cos (2 \ pi \ theta x)}   .
 
Function dependencyG(x) {\ displaystyle G (x)}   fromσ {\ displaystyle \ sigma}  

The moreσ {\ displaystyle \ sigma}   , the flatter form will take function. The smallerσ {\ displaystyle \ sigma}   , the more sharp the peak will be as a result of plotting the function.

 
Function dependencyG(x) {\ displaystyle G (x)}   fromθ {\ displaystyle \ theta}  

The exponential function above has the properties of a normal distribution of a random variable. According to the three sigma rule, almost all exponent values ​​are in the range[-3σ;3σ] {\ displaystyle [-3 \ sigma; 3 \ sigma]}   . For signal analysis, the function values ​​are calculated within the specified limits.

Gabor filter processing of a one-dimensional signal

Each point of the input signalF(x) {\ displaystyle F (x)}   converted to the appropriate output pointF′(x) {\ displaystyle F ^ {'} (x)}   by averaging input valuesF(t) {\ displaystyle F (t)}   by areat∈[x-n2,x+n2] {\ displaystyle t \ in [x - {\ frac {n} {2}}, x + {\ frac {n} {2}}}   taking into account weightsG(i) {\ displaystyle G (i)}   Gabor formulas.
F′(x)=onenΣi=onenF(x-n2+i)⋅G(i){\ displaystyle F ^ {'} (x) = {\ frac {1} {n}} \ sum _ {i = 1} ^ {n} F (x - {\ frac {n} {2}} + i ) \ cdot G (i)}  
Where:
F(x){\ displaystyle F (x)}   - input value of the signal at the pointx {\ displaystyle x}   ,
F′(x){\ displaystyle F ^ {'} (x)}   - output signal at pointx {\ displaystyle x}   ,
G(i){\ displaystyle G (i)}   - the value of the Gabor function,i∈[0,n] {\ displaystyle i \ in [0, n]}   .

Gabor's two-dimensional filter construction algorithm

 
Two-dimensional Gabor function

To build a two-dimensional Gabor filter, the formula is applied:
G(x,y)=exp⁡(-one2[xϕ2σx2+yϕ2σy2])cos⁡(2πθxϕ){\ displaystyle G (x, y) = \ exp \ left (- {\ frac {1} {2}} \ left [{\ frac {x _ {\ phi} ^ {2}} {\ sigma _ {x} ^ {2}}} + {\ frac {y _ {\ phi} ^ {2}} {\ sigma _ {y} ^ {2}}} \ right] \ right) \ cos (2 \ pi \ theta x_ { \ phi})}  
xϕ=xcos⁡(ϕ)+ysin⁡(ϕ){\ displaystyle x _ {\ phi} = x \ cos (\ phi) + y \ sin (\ phi)}  
yϕ=-xsin⁡(ϕ)+ycos⁡(ϕ){\ displaystyle y _ {\ phi} = - x \ sin (\ phi) + y \ cos (\ phi)}  

Where:
σx,σy{\ displaystyle \ sigma _ {x}, \ sigma _ {y}}   - standard deviations of the Gaussian core, along the axesx {\ displaystyle x}   andy {\ displaystyle y}   that determine the length of the filter along the axes,
θ{\ displaystyle \ theta}   - frequency modulation of the filter,
ϕ{\ displaystyle \ phi}   - spatial orientation of the filter, which determines its orientation relative to the main axes.

Gabor two-dimensional image

 
Original fingerprint image
 
Fingerprint image processed by Gabor filter


Image processing by the Gabor filter is achieved by averaging the values ​​of the processed image over a certain area at each point. Accordingly, the imposition of the Gabor filter on the image is:
I′(x,y)=onen2Σi=onenΣj=onenI(x-n2+i,y-n2+j)⋅G(i,j){\ displaystyle I ^ {'} (x, y) = {\ frac {1} {n ^ {2}}} \ sum _ {i = 1} ^ {n} \ sum _ {j = 1} ^ { n} I (x - {\ frac {n} {2}} + i, y - {\ frac {n} {2}} + j) \ cdot G (i, j)}  
Where:
I(x,y){\ displaystyle I (x, y)}   - the intensity of the original image at the point(x,y) {\ displaystyle (x, y)}   ,
I′(x,y){\ displaystyle I ^ {'} (x, y)}   - the intensity of the new image at the point(x,y) {\ displaystyle (x, y)}   ,
G(i,j){\ displaystyle G (i, j)}   - the value of the Gabor function,i∈[0,n],j∈[0,n] {\ displaystyle i \ in [0, n], j \ in [0, n]}   .
If we discard the sinusoidal component of the function in the Gabor filter, it will degenerate into a Gaussian blur filter (Gaussian Blur) . Therefore, it is obvious that these two filters have almost the same application algorithm, which differs in some details.
The Gabor formula shows that the filter depends on the frequency and direction of the quasi-periodic structure of the image. Therefore, before applying the filter, it is necessary to build the frequency and orientation fields for the current image. Usually, to simplify the task, the average image frequency is calculated, which is considered constant at each point.
Several methods can be used to build a field of directions , the fastest of which is the differential method, which allows the construction of a four-gradient field of directions.
Thus, having a frequency and 4 directions, four Gabor filters are pre-built, one for each direction. After that, at each point of the image, the filter is convolved with an image over a specific area, which gives the output value of the new image.
The Gabor filter is effective in processing images with structural redundancy that have a quasiperiodic structure. These include fingerprints, crystallograms and interferrograms. In nature, a similar color is often found in zebras, various felines (tigers, lynxes, smoky cats), birds (grouse), fish (leporinus striped) and other representatives of flora and fauna.

See also

  • Gabor's transformation
  • Denes Gabor

Literature

  • Soifer V.A. Methods of computer image processing. - Fizmatlit, 2003. - p. 459.
  • Khramov, A. G. Methods of computer interferogram restoration. - KuAI, 1988. - p. 88.
Source - https://ru.wikipedia.org/w/index.php?title=Filter_Gabor&oldid=100023646


More articles:

  • 329 (number)
  • Krukovic-Przhejimir, Henryk
  • Clement, Jean-Marie Bernard
  • Forest Street (Samara)
  • Cherekha (river)
  • Anekanta Wada
  • Music Himachal Pradesh
  • Uruguayan Football Championship 1975
  • List of railway workers - Heroes of Socialist Labor
  • Baranenko, Vladimir Yakovlevich

All articles

Clever Geek | 2019