You are on page 1of 6

VEHICLE DETECTION USING GABOR FILTERS

AND AFFINE MOMENT INVARIANTS FROM IMAGE


DATA

Tadayoshi Shioyama1 ,Mohammad Shorif Uddin1 and Yoshihiro Kawai1


1 Kyoto Institute of Technology, Matsugasaki, Sakyo-ku, Kyoto 606-8585, Japan
email: shioyama@kit.ac.jp

Abstract This paper proposes a new method for detecting vehicles from an image. The
method consists in three stages of segmentation, extraction of candidate window
corresponding to a vehicle and detection of a vehicle. From the experimental
results using 121 real images of road scenes, it is found that the proposed method
can successfilly detect vehicles for 120 images among 121 images.

Keywords: Vehicle detection, Gabor filter, segmentation, affine moment invariants

1. Introduction
To improve the mobility of millions of blind people all over the world, an
effective navigation system is very important. This paper addresses a vehicle
detection algorithm for the purpose of developing a travel aid for the blind
pedestrian. Many vision-based methods for detecting vehicles have been pro-
posed for intelligent transportation control or collision avoidance in vehicles
[1],[2],[3],[4],[5]. So far we know, there have been no reports concerning ve-
hicle detection for a pedestrian.
In this paper, we present a new algorithm for detecting vehicles from an
image viewed from a pedestrian. In our method, at first an image is segmented
into regions by using not only color information but also Gabor filter outputs
of a grayscale image. Second, we find a candidate rectangular window corre-
sponding to a vehicle. Third at each region in the window, we calculate the
affine moment invariants for the contour of the region, and compare the invari-
ants with the invariants of reference contours which usually exist in a vehicle
region. If the window has a region with the same invariant as one of these
reference contours, then the window is treated as a area corresponding to a ve-
hicle. For the purpose of evaluating the performance of the proposed method
in detecting vehicles, we perform experiments using many real images.
2. Segmentation Technique
Segmentation is performed using the color information as well as the outputs
of Gabor filters.

HSL color space


We use the HSL color model where H, S and L denote hue angle, saturation
and lightness, respectively. The lightness L takes a value in the range [-1,+1],
the saturation S takes a value in the range [0,1] and the hue angle H takes a
value in the range [0,2 ). We define HSL(x, y) as a vector with three compo-
nents: HSL(x, y) = (L, S cos H, S sin H), where (L, S, H) are values at an image
coordinate (x, y).

Gabor filter
Let f (x, y) be a lightness L at (x, y) in an input image. Then a Gabor trans-
formation of f (x, y) is given by a convolution:
Z Z
2
t + s2
z(x, y) = f (x t, y s) exp exp{ j2 (u0 t + v0 s)}dtds, (1)
2 2

where (u0 , v0 ) are the fundamental frequencies in a two-dimensional frequency


space. The radial frequency r0 is given by r02 = u20 + v20 . A Gaussian window of
a Gabor function has a width . In order to keep a constant number of waves
within the width , we introduce a following relation: r0 = 1/ . For the pur-
pose of detecting vehicles, we empirically use two radial frequencies and four
directions. Eight Gabor filters are optimally allocated in a frequency space [6].
In this paper, we set as r0 = 0.14, = 2.36 for low frequency, and r0 = 0.33,
= 1.0 for high frequency.

Gabor features
We denote GE r0 (x, y) as the normalized output of Gabor filter with a radial
frequency r0 and direction for a grayscale image f (x, y), here r0 = h(High)
and `(Low), and = 0o , 45o , 90o and 135o . The normalization is carried out
so that the maximal output of Gabor filter lies in the range of [0,1]. We define
a feature vector GE(x, y) as a vector with eight components represented by
GE r0 (x, y).

Segmentation
For segmentation, we use both the feature vector GE(x, y) and the color vec-
tor HSL(x, y). The segmentation is carried out by finding a candidate neigh-
boring region j for merging for each considered region i, which satisfies the
following condition:
Ei j = min Ei j D2i j {Ri j + (Mi2j + M 2ji )} and D2i j < T2 , (2)
j
where and T2 are constants, and D2i j k GEi GE j k2 + k HSLi HSL j k2 .
We denote by GEi , HSLi the averages of GE and HSL at region i, by Ri j :Ri j
ni n j /(ni + n j ), by ni the number of pixels in region i, by Mi j the Maharanobis
distance from region i to region j.

(a) (b) (c)

Figure 1. Gabor filter outputs GE90o h .

(a) (b) (c) (d)

Figure 2. Typical contours shown by white lines for a vehicle.

3. Detection of Vehicles
In this section, we find candidate regions for a vehicle by using the result of
segmentation and Gabor filter outputs, and select a region truely corresponding
to a vehicle by using affine moment invariants.

Extraction of candidate regions using segmented regions and


Gabor filter outputs
From the characteristic of the Gabor filter outputs, it is found that the Gabor
filter output GE90o h takes a large value at the boundary between a vehicle and a
nearest road region as illustrated in Fig.1. Hence, we extract candidate regions
for a vehicle by the following algorithm:
Step 1)Find a point (XM,Y M) with the greatest value GMAX of GE90o h on the
boundary of the nearest road region. Here, the nearest road region is found
from the segmented regions obtained in section 2.
Step 2)Consider a rectangular window whose lower left coordinate is (XM
cw,Y M) and whose upper right coordinate is (XM + cw,Y M + ch). Here, the
origin of an image coordinate is set at the lower left point in an image. We set
as cw = 35 and ch = 50 for an image of size (160 120) pixels.
Step 3)Extract regions whose centers of gravity are in the rectangular window
obtained in step 2. The extracted regions are treated as candidate regions cor-
responding to a vehicle as illustrated in Fig.3(a).

(a) (b)

Figure 3. Example of candidate regions(a) and selected regions(b).

Selection of candidate regions using affine moment invariants


After the segmentation, a vehicle is in general segmented into multiple re-
gions. Among these, some regions have typical contours corresponding to a
vehicle, such as side body, side window, front window, bonnet and so on as
illustrated by white lines in Fig.2(a)(d). The typical contours are used for
selecting regions corresponding to a vehicle.

Preselection of candidate regions by P2 /A. We denote by P the peripheral


length of a region contour and denote by A the area of the region. Then, P2 /A
is an indicator of complexity of the shape of region. Hence, using the P2 /A, we
preselect the candidate regions by removing a very complicated region with an
extreme large P2 /A.

Affine moment invariants. The viewpoint related changes in images are


expressed by affine transformations if the distances from a viewpoint to objects
are sufficiently long in comparison with the differences of depths of objects.
Therefore, we use affine moment invariants in order to select regions corre-
sponding to a vehicle, because typical contours of such regions are considered
to be planar. Affine moment invariants are given by [7]

I1 = c1 (20 02 11
2
)/00
4
, (3)
I2 = c2 (20 (21 03 12
2
) 11 (30 03 21 12 ) + 02 (30 12 21
2
))/00
7
, (4)
I3 = log | (30
2 2
03 630 21 12 03 + 430 12
3
+ 421
3
03 321
2 2
12 )/00
10
|. (5)
Here pq denotes the central moment and (x, y) the indicator function. The
coefficients ci , i = 1, 2 are used to make the values of Ii , i = 1, 2 comparable
with each other. The coefficients are set as c1 = 10.0 and c2 = 1000.0.

Selection of candidate regions with affine moment invariants. In learn-


ing process, affine moment invariants Iim , i = 1, 2, m = 1, 2, .., M, for the typical
contours are stored as reference models. For each region j, which satisfies the
condition n j > 40 in a segmented test image, we calculate affine moment in-
variants Ii , i = 1, 2, 3, and select by finding candidate regions which satisfy the
following conditions:
2
((I1 I1m 2
) + (I2 I2m ) + (I3 I3m ) ) < , for m = 1, .., M,
2 1/2
(6)

where is a threshold and is set as = 2.0 empirically. Figure 3(b) shows an


example of selected region which is found from candidate regions in Fig.3(a).

Vehicle detection
Based on the regions selected by affine moment invariants, a vehicle is de-
tected in the following algorithm:
Step 1) Check whether there is a region selected by affine moment invariants
in subsection 3.2.3 or not.
Step 2) If there exist a selected region, then it is decided that there is a vehicle
in the rectangular window. Draw a rectangle.
Step 3) If there exist no selected region, then it is decided that there is no
vehicle in the window. Draw no rectangle on the grayscale image.

4. Experimental Results
We use 121 real images of road scenes including vehicles taken by a 3-CCD
camera (Sony DCR-VX1000) at the height of human eye. The parameters are
empirically set as follows: = 1.0, = 1.0, T1 = 0.03, T2 = 0.7. We use
the reference models for eight typical contours of a vehicle. Some experimen-
tal results are shown in Fig.4. In this figure, a white rectangular window is
shown when the method decides that there exists a vehicle, by using affine mo-
ment invariants of the reference models for a vehicle. The proposed method
successfully detects vehicles for 120 real images among 121 images.

5. Summary
We have proposed a new method for detecting a vehicle using Gabor filters
and affine moment invariants. From experimental results, it is found that the
proposed method can successfully detect vehicles for 120 images among 121
images. We are planning to check the performance of the proposed method
for images without vehicle. It is planned to implement the present method by
making a audio communication link to the blind people as a travel aid.

Acknowledgments
The authors are grateful for the support of Japan society for the Promotion
of Science under Grant-in-Aid for Sientific Research (No.16500110).

References
[1] Z.Duric, et al., Estimating relative vehicle motions in traffic scenes, Pattern Recognition,
Vol.35 (2002) pp.1339-1353.
[2] D.W.Murray and B.F.Buxton, Scene segmentation from visual motion using global opti-
mization, IEEE Trans. on PAMI, Vol.9, No.2 (1987) pp.220-228.
[3] X.Li, Z.Q.Liu and K.M.Leung, Detection of vehicles from traffic scenes using fuzzy inte-
grals, Pattern Recognition, Vol.35 (2002) pp.967-980.
[4] A.K.Jain, N.K.Ratha and S.Lakshmanan, Object detection using Gabor filters, Pattern
Recognition, Vol.30 (1997) pp.295-309.
[5] G.Adiv, Determining three-dimensional motion and structure from optical flow generated
by several moving objects, IEEE Trans. on PAMI, Vol.7, No.4 (1985) pp.384-401.
[6] K.Kawada and S.Arimoto, Hierarchical texture analysis using Gabor expansion, J. of the
Institute of Electronics, Information and Communication Engineers, Vol.J78-DII, No.3
(1995) pp.437-444.
[7] J.Flusser and T.Suk, Pattern recognition by affine moment invariants, Pattern Recogni-
tion, Vol.26 (1993) pp.167-174.

(a) (b) (c) (d)

(e) (f) (g) (h)

Figure 4. Some experimental results.

You might also like