Anda di halaman 1dari 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/261059609

Vehicle detection using morphological image processing technique

Conference Paper · March 2010


DOI: 10.1109/MCIT.2010.5444851

CITATIONS READS

8 819

2 authors, including:

Aisha Ajmal
Victoria University of Wellington
6 PUBLICATIONS   28 CITATIONS   

SEE PROFILE

All content following this page was uploaded by Aisha Ajmal on 22 June 2016.

The user has requested enhancement of the downloaded file.


MCIT 2010

Vehicle Detection Using Morphological Image Processing Technique


(1)
Aisha Ajmal and (2)Ibrahim M. Hussain
Department of Computer Engineering, Sir Syed University of Engineering and Technology,
Karachi−Pakistan
Email: (1)aishaajmal@hotmail.com, (2)hmmiharbi@yahoo.com

Abstract vehicles. Morphological process can also be used for


vehicle classification. Classification of vehicles based
Vehicle detection and classification of vehicles play on their sizes or shapes plays an importation role in
an important role in decision making for the purpose traffic management and flow control [5]. Irrespective
of traffic control and management. In this paper we of the algorithm or technique being employed, camera
propose a novel and efficient algorithm based on positioning and the quality of camera play an
image processing using aerial cameras for vehicle important and critical role in vehicle detection. High
detection and classification especially in highways. altitude aerial camera is an example of camera
The algorithm is mainly based on a sequence of positioning which is often used due to its wide area
morphological methods being applied on an image coverage [6].
taken by an aerial camera of a road segment. The In our paper, we have proposed a technique through
algorithm also uses thresholding and edge detection which the vehicles are detected and classified based on
techniques for vehicle detection. Experiments are their sizes. The algorithm is based on sequence of
carried out over a wide range of vehicles, road morphological steps, image differencing and
segments and camera heights. A success rate of more thresholding. The experiments are carried out on
than 85% and proper vehicle classification is frames (still images) of road segments using near
achieved. vertical positioned cameras. Using the proposed
algorithm, a success rate of more than 85% is
1. Introduction achieved.
Rest of the paper is organized as follows: in section
Image processing plays an important role in various 2, brief descriptions of the experimental scenario along
real time applications ranging from medical imaging to with the initial preprocessing steps are discussed. In
pattern and object recognition for different purposes. section 3, the actual algorithm based on edge detection
One such application is object detection of mobile and morphological process is proposed along with
targets in a particular environment [1]. Vehicle vehicle classification. Finally conclusion is given in
detection on roads is an example of such object section 4.
detection which is used for traffic analysis, monitor
and control. Hence, an initial step for traffic 2. Pre-processing algorithm
controlling is vehicle detection and classification using
traffic measuring techniques. Image processing based As indicated in the previous section, camera
techniques are one of the most widely used techniques position plays an important role in vehicle detection
which achieve this objective. Many algorithms have process. In our case, as we are concerned with the
been proposed connected with vehicle detection and counting and classification of vehicles on road vertical
classification. In [2], image segmentation and edge or near vertical camera position is chosen to cover the
detection methods are employed. In [3], background whole region of interest. Some camera positions and
extraction and estimation techniques are used to isolate the corresponding images taken by these locations are
the vehicles of interest. Similarly vehicle detection can shown in Figure 1.
be achieved with the help of vehicle shadows [4]. This Video cameras are used to monitor a road for a
approach becomes difficult if shadows of other objects specific duration. The obtained video is broken into
like overhead bridges overlap with the shadows of frames at fixed intervals. The resultant images are

65
processed individually to obtain information regarding threshold value is chosen properly according to the
the number of vehicles and their classification at a brightness of the image to be processed. The threshold
particular instant of time. Figure 2 shows a block factor can be chosen with the help of histogram
diagram of the proposed system for vehicle detection characteristic of an image. A series of thresholding is
and classification. applied one after the other on both images which
The frames are passed through two phases, pre- results in multiple binary images. The addition of all
processing phase and then vehicle extraction phase. the images gives a complete refined binary image. This
process is shown in Figure 5 and the obtained images
are shown in Figure 6. Four threshold values are used:
0.2, 0.4, 0.6 and 0.8 respectively. Figure 6 (e) shows
the resultant image after the addition of all threshold
images. After applying the mask on both images,
image differencing takes place which is followed by
filtering the resultant image using a median filter to
remove noise generated by image differencing. Finally
this image is fed into the vehicle detection system and
further classified. The final output image obtained
from the pre processing system is shown in Figure 7.

Figure 1. Camera position from different heights

Figure 3. Flow diagram of the system: (a) Pre-processing


and (b) Vehicle detection
Figure 2. Camera position from different heights

The flow diagram of pre-processing is shown in Fig.


3(a). The steps are as follows: for a particular road
segment on which we want to detect vehicles, two
images are taken, one without vehicles and the other
with vehicles. We call the former image the reference
image and the latter one the current image. Both
images are converted into grayscale images as shown
in Figure 4 (a,b). A mask is used on both images to
isolate region of interest (i.e. roads on which the
vehicles are located) and remove unwanted details
(e.g. paths and fixed objects). A mask and an image
with mask being applied on are shown in Figure 4
(c,d). Both these images are displayed as binary
images since applying a mask is done as binary
operation. To convert both images into binary forms, a Figure 4. (a) Gray scale reference image (b) Gray scale
series of thresholding is applied on both images. The current image (c) Mask (d) Mask applied on current image

66
minimum number of edges as our goal is to have the
outer edges of the vehicle since the inner edges are
irrelevant for overall vehicle detection [7]. Second,
series of linear binary morphological dilations in three
directions horizontally, vertically and through 45
degrees are performed. The result of the three dilations
is shown in Figure 8 (b). It is obvious that the vehicles
are becoming more prominent but at the same time,
some noise objects are becoming larger. Hence these
unwanted objects can give false detection.
Furthermore, binary filling of the holes is performed as
shown in Figure 8 (c). Holes are defined as a set of
background pixels that cannot be reached by filling in
Figure 5. Series of image thresholding using different the background from the edge of image. Note that the
threshold factors unwanted small objects did not increase in size as
result of the filling operation. In order to reduce the
complexity of algorithm, those objects touching the
border of the image are removed as shown in Fig 8(d).

Figure 6. (a) to (d) Series thresholding sub-images (e)


Addition of all sub-images Figure 8. (a) Edge detection (b) First dilation (c) Filling
(d) Border object removal (e) Second dilation (f) Opening

In some cases, when a single vehicle is broken into


adjacent parts due to the previous processing steps, it
is required to connect them otherwise they could be
detected as separate vehicles and gives false detection.
Thus, a second level dilation ensures the connectivity
of such disconnected parts. The structure element used
for this dilation is the diamond structure which is one
Figure 7. Output of the pre-processing algorithm of the most efficient structures in morphological
dilation and erosion. The affect of this dilation is
3. Vehicle detection algorithm evident another frame shown in Figure 9. The blue bus
on the extreme right lane in Figure 9 (a) has black roof
In this section the actual processing for vehicle at three different places. Before applying the second
detection is performed. The steps are shown in Figure level of dilation as indicated by Figure 9 (b), the bus is
3 (b) as follows: first, edge detection is applied on the divided into three parts. Clearly after applying the
image obtained from the preprocessed algorithm as second level dilation as shown in Figure 9 (c), these
shown in Figure 8 (a). The reason for using edge parts are connected as a single vehicle. Although the
detection technique is to obtain contour of the vehicles. second level dilations results in an increase of size of
We have used the „Sobel‟ edge detection to create the unwanted objects, the proportion of increase in the

67
size of target vehicles and unwanted objects is same.
Hence unwanted objects could be easily detected.

Figure 9. (a) Original image (b) Before applying second


level dilation (c) After applying second level dilation

The operation we have used to remove small


unwanted objects is the binary open operation based
on the size of the objects. The range of sizes of such
objects depends on the camera height. For different
Figure 10. (a) Original image (b) Detected vehicles (c)
heights we have selected different opening sizes. Image obtained using the proposed algorithm
Objects that are 8-connected neighborhood and having
sizes smaller than the defined threshold are removed References
using binary opening. Figure 8 (e,f) shows the resultant
images after the second level dilation and the removal [1] Ville Viitaniemi and Jorma Laaksonen , “Techniques
of unwanted objects. At this point the vehicle objects for Image Classification, Object Detection and Object
are prominent without noise or unwanted objects and Segmentation”, in Proc. 10th international conference
ready to be classified. on Visual Information Systems: Web-Based Visual
Information Search and Management, Sept. 2008,
Vehicle classification process starts with isolating
Salerno, Italy, pp. 231 – 234.
each object and reshaping it into a near polygon shape [2] Hossain M. Julius, Dewan M. Ali Akber and
so that it reflects the actual vehicle‟s dimensions from Chae Oksam, “Moving Object Detection for Real Time
an aerial camera. The objects are isolated using 8- Video Surveillance: An Edge Based Approach”, IEICE
connectivity neighborhood. Each detected object is Transactions on Communications, vol. 90, no.
assigned a label indicating the location of each vehicle. 12, pp. 3654 – 3664.
Further, the Convex Hull of each object is calculated [3] Saad M. Al-Garni, and Adel A. Abdennour, “Moving
and the objects are reshaped into near polygon shape. vehicle detection using automatic background
To perform classification, each vehicle type (e.g. extraction”, in proc. World Academy of Science,
Engineering and Technology 2006, Dec. 2006, Sydney,
small, medium and big) is assigned a measurement
Australia, vol. 24, pp. 82-86.
range of sizes. This measurement is based on the area [4] Yoichiro Iwasaki and Hisato Itoyama, “Real-time
and circumference of the vehicles. The object falling Vehicle Detection Using Information of Shadows
within any of these ranges will be classified as small, Underneath Vehicles”, Book Chapter of Advances in
medium or big vehicle. The final result is shown in Computer, Information, and Systems Sciences, and
Figure 10 after detection and classification of the Engineering, Publisher, Springer Netherlands, pp. 94-
vehicles. The detected vehicles are indicated by 98.
rectangular boundaries around them. [5] Gupte, S.; Masoud, O.; Martin, R.F.K. and Papanik
olopoulos, N.P, “Detection and Classification of
4. Conclusions Vehicles”, IEEE Transactions on Intelligent
Transportation Systems, vol. 3, no. 1, Mar 2002, pp.
In this paper, we have developed a novel algorithm 37 – 47.
for vehicle detection and classification based on image [6] Sompoch, P. and Shibasiki R., “Vehicle Detection from
processing. By combining methods of thresholding, Ultra-high Resolution Aerial Image, Three Line
Scanner”, in proc. Geoinformation Forum Japan 2003,
image differencing, edge detection and various
Tokyo, Japan, July 2003, pp. 159-164.
morphological processes, the proposed algorithm gives [7] Weihua Wang, “Reach on Sobel Operator for Vehicle
a success rate of more than 85% in both vehicle Recognition”, in proc. IEEE International Joint
detection and classification which in turn can be very Conference on Artificial Intelligence 2009, July 2009,
useful for traffic analysis and management. California, USA, pp.448-451.

68
View publication stats

Anda mungkin juga menyukai