You are on page 1of 6

Efficient Edge Detection and Object Segmentation Using

Gabor Filters
Yiming Ji Kai H. Chang Chi-Cheng Hung
Depart of Computer Science and Depart of Computer Science and School of Computing and Software
Software Engineering Software Engineering Engineering
Auburn University Auburn University Southern Polytechnic State University
334-8446333 334-8446329 770-5283574
jiyimin@auburn.edu kchang@eng.auburn.edu chung@spsu.edu

ABSTRACT f ( x ) = ∑
ω ∈ R
F (ω ) e 2 π iω t

Gabor filter is a widely used feature extraction method, especially



− 2 π ix ω
in image texture analysis. The selection of optimal filter F (ω ) = f ( x ) e dx
parameters is usually problematic and unclear. This study R
analyzes the filter design essentials and proposes two different
methods to segment the Gabor filtered multi-channel images. The In signal analysis, f(x) describes the temporal behavior, and F(ω)
first method integrates Gabor filters with labeling algorithm for describes the frequency behavior. In general, Fourier expansion
edge detection and object segmentation. The second method uses is difficult to recognize features between f and F, so it is an ideal
the K-means clustering with simulated annealing for image tool only for stationary (or time invariant) signals.
segmentation of a stack of Gabor filtered multi-channel images. Gabor expansion is a time-frequency analysis method, which was
Various experiments with real images demonstrate the introduced in 1946 by Dennis Gabor [2]. This expansion
effectiveness of these approaches. introduces a time-localization Gaussian window function (g(t-x),
where x is a shifting parameter used to translate the window in
Categories and Subject Descriptors order to cover the whole time domain) for extracting local
H.2.0 [Image]: segmentation, denoising information of signal with the form similar to the Fourier
transformation [3][4][5]:

General Terms C ( x , ω ) = ∫ f (t ) g (t − x )e − 2 π it ω
dt
Algorithms, Theory R

where g(t − x ) is the conjugate form of g(t-x), and coefficient


Keywords C(x, ω) depends linearly on the original signal f(t). Some
Gabor filter, segmentation, labeling, K-means, simulated properties of the Gabor transform (energy preservation, inversion
annealing. formula) are similar to those of the Fourier transformation. The
Gabor filter tries to search and investigate the intermediate
1. INTRODUCTION representations which combine the information of both time/space
Image segmentation continues to be an important and active information f and frequency information F [6-7]. The goal is a
research area in image analysis. In order to analyze complicated simultaneous description of the temporal and spectral behavior of
image signals, engineers and mathematicians have been searching a function or signal f. Such a representation is essentially two-
for a simple, yet well-understood representation. Fourier dimensional, measuring both behavior of the frequency w and
expansions, Gabor expansions, and Wavelet expansions are good time/space t.
examples. There are two main approaches for Gabor transform computation
Fourier expansion [1] represents signals in a series of sine waves, [7]. One focuses on the matrix factorization, which is based on
and the classical Fourier analysis employs two complementary the periodic and sparse structure of Gabor operator, and the
representations: the function f itself and its transforms F: factorization holds in general and does not depend on number
theoretic condition on the lattice parameters of time/space and
frequency. The second and efficient method is an iterative
approach, which uses the Conjugate Gradient (CG) method to
approximate the optimal dual window. In general CG method is
more computationally efficient for large size matrix [7].
However, the classic Gabor expansion is computationally
Permission to make digital or hard copies of all or part of this work for
personal or classroom use is granted without fee provided that copies are
expensive [3-5], and since it combines all the space and frequency
not made or distributed for profit or commercial advantage and that details of the original signal, it is difficult to take advantage of the
copies bear this notice and the full citation on the first page. To copy gigantic amount of numbers.
otherwise, or republish, to post on servers or to redistribute to lists,
requires prior specific permission and/or a fee.
Fortunately, these problems can be partially overcome by using a
ACMSE ’04, April 2-3, 2004, Huntsville, Alabama, USA. multi-channel filtering technique, which uses specified filters to
Copyright 2004 ACM 1-58113-870-9/04/04…$5.00. select the information at particular space/frequency points.

454
Research has demonstrated that Gabor expansion can be When an image is processed by a Gabor filter, the output is the
implemented as a multi-channel, wavelet-like filter and this multi- convolution of the image i(x,y) and the Gabor function g(x,y),
channel filtering process mimics the characteristics of the human i.e., r ( x , y ) = g ( x , y ) * i ( x , y ) , where * denotes the two
visual system (HVS) [8-9]. If an image containing more than two dimensional convolution. This process can be used at different
object regions is fed to a Gabor filter bank, then local spatial- frequencies and different orientations, and the result is a multi-
frequency differences between these objects hopefully will show channel filter bank. Figure 1 illustrates the multi-channel filtering
variation in the filtered sub-images. This filtering approach is a system.
natural way to manipulate variation between image objects.
Gabor filters have been used in detecting texture edge [10, 11].
However, it is based on traditional Gradient method. It does not
specify the choice of frequency/scale range, and as a result, it can
not take advantage of the edge information for further analysis.
Wavelet expansion is an excellent technique which is now
commonly used in image compressions and image restorations.
Comparing Gabor expansion with Wavelet analysis technique, Figure 1 Gabor multi-channel system
Oscar Nesta, Rafael Navarro, Javier Portilla and Antonio
Tabernero [12] concluded that Gabor expansion is the only In Fig. 1, operator | · | is the magnitude operator, and gk(x,y) is the
biologically plausible filters with orientation selectivity that can Gabor function in the kth channel, which denotes a specific
be exactly expressed as a sum of only two separable filters [12, frequency and orientation.
13]. This unique property has made Gabor filter an important
With the multi-channel filtering system, an image will be
transformation in image processing.
processed by all the channels simultaneously. The result is a
While there are many image segmentation algorithms and much stack of filtered images which are defined at various frequencies
research has successfully used Gabor filters for texture analysis and orientations corresponding to all the channels in the system.
[10, 11, 14, 16], this study tries to provide additional insight into Hence, characteristic image information at each particular
the design of optimal Gabor filters, and proposes two different frequency and individual orientation is obtained.
segmentation algorithms. The first approach integrates images
from all the channels and applies labeling algorithm for 2.2 Choice of Gabor Filter Parameters
segmentation. The second approach analyzes multi-channel Although it is stated by David A. Clausi [8] that the collection of
images using the K-means with simulated annealing algorithm. results of every 30o will provide a robust and universal feature set,
Both methods have unique applications: the first one is very this study uses four values of 0 o, 45 o, 90 o, and 135 o to save
efficient while the second is especially good for noisy image computation time. According to [12], [14], [16], and [18], the
analysis. central frequency is selected according to the image dimension.
That is, the following set of values is used:
The next section presents the Gabor filter design. Section 3 N cycles/image-width, with N being
applies the designed filters to images and discusses how Gabor 2 ,2 2 ,..., and 2
4
filters can capture image features by analyzing the edge the number of the image columns. The radial frequencies are all 1
information. Then, in section 4, the labeling segmentation and the octave apart [19].
K-means simulated annealing algorithm are briefly described.
Experiments on images are shown in section 5, and discussions Low frequency corresponds to smooth variations and constitutes
and conclusions then follow. the base of an image and high frequency presents the edge
information which gives the detailed information in the image.
Hence, this study neglects the very low radial frequencies,
2. Gabor filter Design e.q., 2 , and 2 2 . Using these frequencies and orientations,
2.1 Gabor function and multi-channel system the Gabor filter Multi-channel system can present an image in
There are several forms of 2-D Gabor filter, and this study uses a various orientations and frequencies.
version similar to Daugman’s model which is used in spatial
summation properties (of the receptive fields) of simple cells in
the visual cortex [17]. It is defined as:
3. Edge detection specifics
This section uses an image to analyze the boundary effect of the
αβ Gabor filters. Figure 2 (2.a) shows a test image of size 100×154.
g ( x, y ) = exp( −α 2 x ' 2 + β 2 y ' 2 ) exp( j 2π f 0 x ' ) When the original image (2.a) is fed to the above Gabor multi-
π
channel system (no post-processing for this analysis), the
x ' = x cos θ + y sin θ integration image is (2.b). In order to illustrate the details, image
y ' = − x sin θ + y cos θ (2.a) and (2.b) are filtered by the same low-pass filter, and the
results are (2.c) and (2.d) respectively. (The kernel length of the
where the arguments, x and y, specify the position of a scene, f0 is low-pass filter is 5).
the central frequency of a sinusoidal plane wave, θ is the counter
clockwise rotation of the Gaussian plane wave, and α and β are Image (2.a) contains 4 texture patterns of same size and each
the sharpness values of the major and minor axes of the elliptic pattern has 50X78 pixels. In order to compare the Gabor effect
Gaussian. along the texture boundaries, pixel intensities of images (2.c) and
(2.d) of Figure 2 along different rows and columns are

455
highlighted. Specifically, the pixel intensities along column No. This study fully takes advantages of this property and labels
25 and column No. 85, and along rows 25 and 75 are marked with distinct components based on the labeling algorithm [20, 21, 22].
the dotted lines. Then the connectivity of each labeled region is measured
accordingly. Here, a simple method is to count the number of the
pixels within a region: if there are few pixels in a labeled region,
it can be assumed that the pixels within the region may represent
noisy, unrelated signals and thus can be neglected; otherwise, the
region is considered to contain part of the edge information. In
this study, a threshold of 50 is used for all test images.

4.2 Segmentation by simulated annealing with


K-means
While the first method takes advantage of the overall effect of the
Figure 2. A test image and results. Gabor filtering images, this second method tries to analyze all the
Fig. 3 shows the pixel intensities comparison result along the muti-channel sub-images directly. Here, the K-means works on a
specified rows and columns. The circled lines in Fig. 3 represent pixel vector instead of a single pixel value.
the row/column pixel intensities of Gabor filtered image for (2.d) Simulated annealing is an optimization algorithm that is based on
and the continuous lines correspond to original image (2.c). the process of annealing metals. The integration of simulated
annealing with K-means is to search optimal clustering solution
by exploring most promising path similar to the way a metal
cooling down to optimal state [25]. Below details the process
involved in this algorithm.
Step 1: Determine the number of clusters (K) and initialize center
for the clusters.
Step 2: Define the temperature, Tmax for highest temperature and
Tmin for the cooling down value.
Figure 3. Intensities along specified rows/columns
Step 3: Distribute pixel vectors into K clusters and calculate the
It is obvious from Fig. 3 that the Gabor filters successfully total variance among them.
capture and optimize the distinctions along the border of object Step 4: If the total variance is less than the first loop, keep the
regions (as circled by dotted ovals in Figure 3). For charts (3.a), distribution; otherwise, select a random number r by tossing a
(3.b) and (3.c), the difference of intensities for the original image dice and calculate the annealing probability:
is less that 0.15, while it is more than 0.4 for the Gabor processed P ( c ) = exp( − c / kT ) ,
images. The reason is that Gabor filters only choose higher
frequency information (which stands for edge/boundary property) where P(c) is the probability of a change of c in the objective
from original images, and as a result, the edge is maximized and function and k is a constant analogous to Boltzmann’s constant
different objects are separated. It is this property that provides that must be chosen for the classification.
level information among objects and, therefore, basis for many
different segmentation algorithms. For example, some researchers If annealing probability P(c) is greater than the random number,
blur the Gabor filtered images one more step and apply threshold keep the change, otherwise discard the update.
to classify the texture images [13, 14, 16], and other researchers Step 5: Increase the iteration and update the temperature with:
use gradient to locate the boundary [10]. T = T max /( 1 + iteration ) , repeat steps 3, 4, and 5 until
4. Image segmentation T<Tmin.
Two different algorithms are proposed for the image
segmentation. One follows the traditional integration method and 5. Experimental results
applies the labeling algorithm for the integrated image for edge This section presents multiple experiments for the above Gabor
detection and object segmentation. The second approach system. For labeling segmentation, three different applications
combines simulated annealing method with K-means clustering are demonstrated, and within each application, a group of two
algorithm for a stack of multi-channel sub-images directly. images are provided. For the simulated annealing with the K-
means segmentation, a set of experiments are compared,
4.1 Labeling segmentation especially for noisy image.
In order to identify objects from the background, the obtained
image can be measured with different approaches [8, 13, 14, 16, 5.1 Labeling segmentation
and 18]. The most common one is to integrate the multi-channel For each testing image, an intermediate Gabor filtered image and
images first, and the resultant image generally will be separated at the final edge or segmentation image are presented. All
distinguishable intensity levels. experiments use the same parameters as discussed above, and the
experiments are performed in Matlab version 6.1.

456
The experiments presented here are mainly for illustrating the
algorithm, and all of them assume that there is only one main
object. However, for complex images, threshold can be used to
separate different object regions.

5.1.1 Edge detection


Fig. 4 shows two images, Bacteria (a1) and Rice (a2). Images
(b1) and (b2) are the Gabor filtered images and the resultant edge
images are (c1) and (c2).

Figure 6. Background segmentation.

In this experiment, the Gabor system separates objects and


their backgrounds, and the obtained boundary contours
show the backgrounds of the two images clearly. For the
Bonemarr image, the proposed method successfully detects
the dotted particle signals as shown in (c1).

5.1.3 Object segmentation


Fig. 7 shows two aurora images, aurora-1 (a1) and aurora-2 (a2).
Figure 4. Edge detection
Images (b1) and (b2) are the Gabor filtered images and images
As shown in (b1) and (b2), Gabor filter optimizes the edge (c1) and (c2) are aurora objects of (a) and (c), respectively
information of both images by separating the objects and their
backgrounds into two intensities levels and highlighting the
borders of bacteria and rice objects. Figure 5 shows two edge
images (bacteria and rice) generated by general Gradient based
edge detection algorithm. When compared with the Gabor results
(c1) and (c2), the Gradient edge detection algorithm does not
successfully capture some of the weak borders.

Figure 5. Edge detection with general Gradient algorithm Figure 7. Object Segmentation

Noted that there exist many variant algorithms for the Gradient Here, the Gabor filter effectively segments the aurora
approach, and most of them are very good. For example, the objects while retaining the details of the auroras. When
Canny method [23] finds edges by looking for local maxima of compared with other segmentation algorithms, we find that
the gradient of the image. The gradient is calculated using the other segmentation methods can hardly keep the detailed
derivative of a Gaussian filter, and it is likely to detect true weak properties of the object. Figure 8 shows segmentation
edges with minor differences. However, pure edge detection results of the above aurora images by the K-means
algorithm can not provide level information between object algorithm [24].
regions.

5.1.2 Background segmentation


Fig. 6 shows two images, one is a Bonemarr image (a1) and the
other is an Afmsurf image (a2). Images (b1) and (b2) are Gabor
filtered images, and images (c1) and (c2) are the background of
(a1) and (a2), respectively.

Figure 8. Object segmentation using K-means algorithm

457
5.2 Segmentation by simulated annealing with
K-means algorithm
5.2.1 Segmentation with original images and Gabor
filtered multi-channel images
A set of five satellite images are used in this experiment and one
of the images is shown in Fig. 9 (a). The original images and the
Gabor filtered multi-channel images are segmented by the
simulated annealing with K-means method; and the results are
shown in Fig. 9 (b) and (c).

Figure 10. Segmentation of noisy images.

6. Discussions and Conclusions


Figure 9. Segmentation with simulated annealing with K- This paper analyzes the details of the Gabor multi-channel
means algorithm. filtering system, and presents two new approaches for image
The cluster number K is 4 for this experiment. Though we do not segmentation. Analysis of Gabor filter shows that it can optimize
have ground data for more detailed comparisons, direct the differences along borders among object regions, and thus they
examination shows the segmentation with Gabor filtered multi- are natural tools for image segmentation.
channel images presents better solutions. By using the multi-channel scheme, the provided Gabor system
avoids the tricky filter selection process. Both proposed
5.2.2 Segmentation with noisy images segmentation methods successfully take the advantages of the
In this experiment, we first add Gaussian noise to the Gabor filtering system. The labeling segmentation method
original images and use the simulated annealing K-Means follows the common routine by integrating all the multi-channel
algorithm to segment the noisy original images. sub-images together, and applies labeling algorithm to the
integrated image. The simulated annealing K-means approach
The noisy original image is shown in Fig. 10(a). The added noise tries a different solution by considering the multi-channel sub-
is Gaussian noise with average 0 and variance 0.1. We apply a images directly and extracting the clusters optimally. Multiple
median filter for the noisy images and the restored image is experiments show that with the presented segmentation methods,
shown in Fig. 10(b). The segmentation results for the original the Gabor system can effectively eliminate noisy signals while
noisy images, restored noisy images and the Gabor filtered noisy maintaining the details of the image objects successfully.
images are shown in Fig 10. (c), (d) and (e) separately.
It is shown that images (c) and (d) are still noisy, though (d) is 7. REFERENCES
much better than (c), and the result (e) from the Gabor filtered [1] Sanjit K. Mitra, “Digital Signal Processing A Computer-
multi-channel does not contain any noisy signals. The reason is Based Approach,” section edition, Mc Graw Hill, 2001.
that the Gabor multi-channel filtering process selects parts of
essential signals from original image and discards others [2] D. Gabor, “Theory of Communications.” J. Inst. Elec.Eng.,
including the noise signals. vol. 93, pp.429-457, 1946.

While there are many restoration algorithms, generally it is very [3] Jie Yao, Patrick Krolak, and Charlie Steele, “The
difficult to eliminate all the noisy signals, and when applying the Generalized Gabor Transform,” IEEE Transactions on Image
segmentation method to the restored images, the results will still Processing, Vol. 4. Issue 7, July 1995, page: 978-988.
be noisy. The Gabor multi-channel filtering system can be [4] Liang Tao, H.K. Kwan, “Real-Valued Discrete Gabor
immune to the noise and thus it could be very useful in Transform for Image Representation,” IEEE International
segmenting real images. Symposium on Circuits and Systems, volume 2, May 2001,
page: 589-592.
[5] Shie Qian, Dapang Chen, ‘Discrete Gabor Transform.” IEEE
Transactions on Signal Processing, vol. 41, No. 7, July 1993.
[6] R. Navarro, A. Tabernero, and G. Cristobal, “Image
Representation with Gabor Wavelets and Its Applications,”
in Advances in Imaging and Electron Physics, vol. 97, P. W.
Hawkes, Academic Press, San Diego CA, pp. 1-84, 1996.

458
[7] Hans G. Frichtinger, Thomas Stroher, “Gabor analysis and [17] J.G Daugman, “Uncertainty relations for resolution in space,
algorithms, theory and applications,” Chap 8, Birkhauser, spatial frequency, and orientation optimized by two-
1998. dimensional visual cordial filters,” Journal of the Optical
Society of America, vol.2, no. 7, pp. 1160-1169, 1985.
[8] David A. Clausi, M. Ed Jernigan, “Designing Gabor filters
for optimal texture separability,” Pattern Recognition 33, pp. [18] Jiang Wen, You Zhisheng, Li Hui, “Segmentation the
1835-1849, 2000. Metallograph Images Using Gabor Filgter,” International
Symposium on Speech, Image Processing and Neural
[9] Dennis Dunn, Willian E. Higgins, “Optimal Gabor Filters for
Networks, pp. 13-16, April 1994, HongKong.
Texture Segmentation,” IEEE Transactions on Image
Processing, vol. 4, no. 7, July 1995. [19] Pollen, D.A. and Ronner, S.F. “Visual Cortical Neurons as
Localized Spatial Frequency Filters,” IEEE Trans. SMC, vol.
[10] Juliang Shao, Wolfgan Főrstner, “Gabor Wavelets for
13, no. 5, pp.907-916, 1983.
Texture Edge Extraction,” Comm. III Symposium, 1994.
[20] Haralick, Robert M., and Linda G. Shapiro, “Computer and
[11] Josef Bigűn, J.M. Hans du Buf, “N-folded Symmetries by
Robot Vision, Volume I,” Addison-Wesley, pp. 28-48, 1992.
Complex Moments in Gabor Space and Their Application to
Unsupervised Texture Segmentation,” IEEE Transactions on [21] Anil K. Jain, “Fundamentals of Digital Image Processing,”
Pattern Analysis and Machine Intelligence, vol. 16. No. 1, Prentice Hall Information and System Sciences Series, pp.
Jan 1994. 409-411, 1989.
[12] Oscar Nestares, Rafael Navarro, Javier Portilla and Antonio [22] Jung_Me Park, Carl G. Looney, Hui_Chuan Chen, “Fast
Tabernero, “Efficient Spatial-Domain Implementation of a Connected Component Labeling Algorithm Using A Divide
Multiscale Image Representation Based on Gabor and Conquer Technique.” Technical report, 2000.
Functions,” J. Electronic Imaging, 7, pp. 166-173, 1998. (http://cs.ua.edu/TechnicalReports/TR-2000-04.pdf).
[13] Thomas P. Weldon, William E. Higgins, “Integrated [23] J. F. Canny. “A computational approach to edge detection,”
Approach to Texture Segmentation Using Multiple Gabor IEEE Trans. Pattern Analysis and Machine Intelligence, pp.
Filters,” Proceedings, International Conference on Image 679-698, 1986.
Processing, Volume 3, Sept. 1996, page 955-958.
[24] Vance Faber, “Clustering and the Continuous k-Means
[14] Anil K. Jain, Farshid Farrokhnia, “Unsupervised Texture Algorithm,” Las Alamos Science, Number 22, 1994.
Segmentation Using Gabor Filters,” Conference
[25] Randy Daniel, “A comparison of simulated annealing and
Proceedigns, IEEE International Conference on Systems,
tabu search as applied to the classification of digital images,”
Man and Cybernetics. Nov. 1990, pages 14-19.
MS thesis, School of computing and software engineering,
[15] Joni Kamarainen, Ville Kyrki and Heikki Kälviäinen,, Southern Polytechnic State University, December 2002.
“Fundamental Frequency Gabor Filters for Object
Recognition,” Proceedings, 16th International Conference On
Pattern Recognition, Volume 1, Aug. 2002, page 628-631.
[16] Neena Mittal, D.P. Mital, Kap Luk Chan, “Features for
Texture Segmentation Using Gabor Filters,” Image
Processing and its Applications, Conference Publication No.
465, 1999.

459

You might also like