0% found this document useful (0 votes)
67 views7 pages

Speed Estimation On Moving Vehicle Based On Digital Image Processing

This document summarizes a research paper on estimating the speed of moving vehicles using digital image processing from video data. The system takes video frames as input and performs pre-processing like shadow removal. Moving objects are extracted using Gaussian mixture modeling (GMM) background subtraction. The detected vehicle is tracked between frames and its centroid distance is calculated to estimate speed using the Euclidean distance formula. The system was tested with videos captured from different camera angles to analyze the effect on speed estimation accuracy, which ranged from 87.01% to 99.38%.

Uploaded by

Anjali Kulthe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views7 pages

Speed Estimation On Moving Vehicle Based On Digital Image Processing

This document summarizes a research paper on estimating the speed of moving vehicles using digital image processing from video data. The system takes video frames as input and performs pre-processing like shadow removal. Moving objects are extracted using Gaussian mixture modeling (GMM) background subtraction. The detected vehicle is tracked between frames and its centroid distance is calculated to estimate speed using the Euclidean distance formula. The system was tested with videos captured from different camera angles to analyze the effect on speed estimation accuracy, which ranged from 87.01% to 99.38%.

Uploaded by

Anjali Kulthe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

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

net/publication/317312246

Speed Estimation On Moving Vehicle Based On Digital Image Processing

Article  in  International Journal of Computing Science and Applied Mathematics · March 2017


DOI: 10.12962/j24775401.v3i1.2117

CITATIONS READS
8 1,963

2 authors, including:

Budi Setiyono
Institut Teknologi Sepuluh Nopember
34 PUBLICATIONS   47 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

papers View project

All content following this page was uploaded by Budi Setiyono on 29 September 2017.

The user has requested enhancement of the downloaded file.


INTERNATIONAL JOURNAL OF COMPUTING SCIENCE AND APPLIED MATHEMATICS, VOL. 3, NO. 1, FEBRUARY 2017 21

Speed Estimation On Moving Vehicle Based On


Digital Image Processing
Danang Wahyu Wicaksono and Budi Setiyono

Abstract—Along with the development of information and effect, median filtering to remove noise, and morphological
communication technology, the world urban people now recog- operation to reconstruct broken foreground image after noise
nize a new term called Smart City. One of Smart City components removing process for better object detection. We use Euclidean
is smart transportation, known as Intelligent Transportation
System (ITS) in which there is transportation management on distance to calculate the distance of moving object from 2
the highway. Installation of CCTV (Closed Circuit Television) consecutive frames by its centroid point while object is being
on the streets are now widely performed. It can be used to tracked along in ROI (Region of Interest) then the distance is
monitor conditions and detect problems such as traffic jam and divided by time between frames to get estimated speed. For
vehicle speed limit violation. This research focuses on vehicle simulation, we use JAVA Programming with OpenCV library.
speed estimation using image processing from video data and
Euclidean distance method with many different camera angles.
The first step, video data is extracted into frames and applied pre- II. R ELATED W ORK
processing to extracted frames to minimize shadow effect. Then, There are many researches with the same topic for es-
using Gaussian Mixture Model (GMM) to extract foreground
image. In the next step, the obtained foreground is filtered using
timating vehicle speed based on image processing. Arash
median filter, shadow removing, and morphology operation. The Golami R. with the paper ”Vehicle Speed Detection in Video
detected vehicle object will be tracked to determine the location in Image Sequences using CVS method” uses CVS as back-
each frame to estimate the speed based on its distance between ground model and Euclidean distance and get the highest
frames. From the obtained results, this system is capable on accuracy 90% [3]. Jinhui Lan with the paper ”Vehicle Speed
estimating the speed of moving vehicle with the lowest accuracy
is 87.01% and the highest accuracy is 99.38%.
Measurement based on Gray Constraint Optical Flow” uses
Index Terms—Digital image processing, moving vehicle, speed optical flow and three frames differencing to measure vehicle
estimation. speed and get the highest accuracy 99% [4], but as we know
optical flow has high complexity algorithm and more sensitive
to noise. Hardy Santosa and Agus Harjoko with the paper
I. I NTRODUCTION ”Vehicle Counting and Vehicle Speed Measurement Based On
NE of smart city components is smart transportation,
O known as Intelligent Transportation System (ITS) in
which there is transportation management on the highway.
Video Processing” use Euclidean distance to measure vehicle
speed and get the highest accuracy 90.5% [5]. Asif Khan
with the paper ”Speed Estimation of Vehicle in Intelligent
Smart traffic monitoring system is uncompleted without the Traffic Surveillance System Using Video Image Processing”
existence of system that is capable to detect any traffic also uses Euclidean distance to estimate vehicle speed and get
problems automatically, such as traffic rules violation and the highest accuracy 98.12% [6]. But those papers did not
traffic jam. Traffic jam can be detected from speed that is slow do research about the influence of camera angles and ROI
and followed by high volume of vehicles, so it is important selection for the best result for estimating vehicle speed from
to detect and estimate speed for knowing road profile based video data. This paper adds discussions about the influence of
on the vehicle speed. Besides, there are many researches for camera angles and ROI selection for estimating vehicle speed
classifying and counting vehicle object from video image based on image processing. Camera angle is an important
[1] in which adding speed estimation process will give a aspect for determining the best position for the camera that
contribution to build a smart system for traffic monitoring that will be placed on the traffic.
is able to do detecting, counting, classifying, and estimating
speed for vehicle object from video data. III. S YSTEM A RCHITECTURE
In this paper, several steps are used to build a system that ca- The system architecture for estimating vehicle speed from
pable to estimate vehicle speed from video data captured from video data consists of 9 processes that are discussed further
highway at fixed or static position with different camera angles later in this paper. Each process will do particular work which
to know its influence for speed estimation result. Using the the result will be used by next process until estimated speed
advantage of background subtraction with Gaussian Mixture is calculated. Block diagram for this system is given by Fig.
Model (GMM) to extract and detect moving object from video 1.
[2], contrast and brightness adjustment to minimize shadow
Manuscript received February 2, 2017; accepted February 20, 2017. A. Video Input
The authors are with the Department of Mathematics, Institut
Teknologi Sepuluh Nopember, Surabaya 60111, Indonesia. Email: Video data is captured from static camera at top position of
[email protected], [email protected] highway, using geometric equation to calculate perpendicular
22 INTERNATIONAL JOURNAL OF COMPUTING SCIENCE AND APPLIED MATHEMATICS, VOL. 3, NO. 1, FEBRUARY 2017

0. To minimize bold shadow which can be detected as solid


object, α should be decreased and β should be increased
with a certain change of α and β that the result can be seen
from histogram of image result from background subtraction
process.

C. Background Subtraction
Background subtraction is used to extract foreground im-
age based on background model for each frame. There
are many background subtraction methods which have their
Fig. 1. Block Diagram for System Architecture
own advantages and disadvantages. This paper uses Gaussian
Mixture Model known as GMM method to do background
view (P) and distance between object and camera (D) based subtraction process because it is a good algorithm to use for
on camera height (H), field of view angle of the camera (Tc ), the classification of static postures and non-temporal pattern
and angle of the camera (Tv ). Perpendicular view is used recognition, more robust than other models, and it can handle
to calibrate estimated speed to standard unit, km/h. Video multi-modal situations [6]. To implement GMM method, we
capturing layout is given by Fig. 2. From Fig. 2, we can get use BackgroundSubtractor class from OpenCV library. Back-
groundSubtractor in OpenCV will produce foreground image
with 3 gray levels, 255 for moving object, 127 for object
shadow, and 0 for background.

D. Smoothing
Smoothing is used to filter or reduce noise produced from
background subtraction process. The noise generated from
background subtraction is typically in salt and pepper type
in which using median filter is good to reduce the noise. The
illustration how median filter works is given by Fig. 3.

Fig. 2. Video Capturing Layout

v
Tc = 2 arctan( ) (1)
2f
Tc
T = Tv + (2)
2
where f is focal length of the camera and v is vertical
dimension of 35 mm image format which can be found from
camera specifications. Then, we can get
D = H tan(T ) (3)
and Fig. 3. Median Filter
Tc p 2
P = 2 tan( ) H + D2 (4)
2

B. Preprocessing E. Shadow Removal


Background subtraction using GMM can also be used to
Video data is extracted to frames and each frame is applied
detect shadow, so to increase object detection accuracy, the
preprocessing before frame is being processed by background
shadow should be removed. This process will map foreground
subtraction. Preprocessing is used to minimize bold shadow
image produced from GMM to binary image which contain
that can be detected as solid object which can decrease object
only pixel value 1 and 0 for identify moving object and
detection accuracy. This paper uses brightness and contrast
background respectively. Equation (6) is used to this shadow
adjustment for preprocessing step which has general equation
removal and mapping process and illustration is given by Fig.
given by
4.
g(i, j) = α f (i, j) + β (5) 
0 i f Igray (i, j) = 0 or Igray (i, j) = 127
where f (i, j) is pixel intensity in coordinate (i, j), α is gain Ibinary (i, j) = (6)
1 if Igray (i, j) = 255
parameter with default 1, and β is bias parameter with default
WICAKSONO et al.: SPEED ESTIMATION ON MOVING VEHICLE BASED ON DIGITAL IMAGE PROCESSING 23

the most important thing in this paper for speed estimation


by using Euclidean distance to know the distance traveled by
the object from two consecutive frames by its center point.
Let B(i, j) is a bounding box which starts at coordinate (i, j),
then centroid point C(i, j) which is coordinate (Ci ,C j ) can be
determined by
C(i, j) = (Ci ,C j ) (7)
with
Bwidth Bheight
Ci = Bi + , Cj = Bj + (8)
2 2
where Ci is centroid coordinate at row i, C j is centroid
coordinate at column j, Bi is bounding box coordinate at row i,
B j is bounding box coordinate at column j, Bwidth is the width
of bounding box, and Bheight is the height of bounding box.
Fig. 4. Shadow Removal Process
Illustration for object detection and centroid determination is
given by Fig. 6.
F. Morphology Operation
In this paper, morphology operation is used to reconstruct
image after shadow removal process. Shadow removal process
usually creates a gap inside object which if that gap is too
large, it can make object will be separated that can affect object
detection accuracy. There are two fundamental processes in
image morphology, erosion and dilation which erosion will
do shrinking and thinning operation to objects and dilation
will grow or thicken objects in binary image. From these Fig. 6. Object Detection based on Contour Finding (left) and Centroid based
two fundamental processes, there are opening and closing on Bounding Box (right). Green pixels represent border of the object, red
operation that is combination of erosion and dilation. Opening point represents centroid point, and red rectangle represents bounding box
is the process that do erosion firstly and then followed by
dilation, generally smooths the contour of an object, breaks
H. Labeling and Tracking
narrow isthmuses, and eliminates thin protrusions. Closing
is the process that do dilation firstly and then followed Labeling is a process that gives a label for the detected
by erosion, generally smooths sections of contours but, as object to know the same object at next frame. While the object
opposed to opening, it fuses narrow breaks and long thing is in ROI, the object will be tracked and system will calculate
gulfs, eliminate small holes, and fills gaps in the contours [7]. the distance using Euclidean distance and then calculated the
To reconstruct image which contain gaps, we will use this estimated speed between two consecutive frames. This speed
closing operation. Illustration of how closing operation works calculation is always done while object is in ROI and being
to an object on binary image is given by Fig. 5. tracked, so what happen is there are more than one speed
calculations and save them to a speed list for the object and
when the object is out of ROI, system will calculate average
speed of the object based on its speed list, so the result for
estimated speed in this paper is the average speed. Speed
estimation process will be discussed further in the next section
after this section.

I. Speed Estimation
Speed estimation is done by calculate the distance traveled
by the object for two consecutive frames and then divided by
time between two frames. To calculate the distance traveled
Fig. 5. Closing Operation in Image Morphology
by the object for two consecutive frames using Euclidean
distance, let Ct (a, b) and Ct+1 (c, d) is centroid point of the
object in frame t and t + 1 respectively. The distance d
G. Object Detection calculated by Euclidean distance is given below
In this paper, object detection is done by finding object q
contours on the binary images. This process uses findContours d = (a − c)2 + (b − d)2 (9)
function from OpenCV to detect moving objects. For each To calculate speed V between two frames, we use
detected object, bounding box is given to identify and also to d
determine centroid point for the object. This centroid point is V =k (10)
t
24 INTERNATIONAL JOURNAL OF COMPUTING SCIENCE AND APPLIED MATHEMATICS, VOL. 3, NO. 1, FEBRUARY 2017


where k is calibration coefficient based on perpendicular view P = 2 7.62 + 45.6612 tan( 41.10
2 ) = 34.705 meters, and k =
P and image height Iheight and t is time between two frames 34.705/240 = 0.145, so the estimated speed for given example
2.82
which is given by is V = (3.6)(0.145)( 0.033 ) ≈ 44.765 km/h.
P 1
k= , t= (11) IV. R ESULTS AND D ISCUSSIONS
Iheight f ps
Speed V from Equation 10 above is still in unit meter per A. Experiment Data
second or ms , so that we have to convert it to standard unit of Video data for experimental need in this paper is derived
speed, kilometer per hour or km h by multiplying 3.6 which is from acquisition process on highway according to the video
given by Equation 12. capturing layout at Fig. 2. There are two aspects of data, the
d vehicle speed and the camera angle that is used for video
V = 3.6k (12) acquisition. For video acquisition process, we use motorcycle
t
which run relative constantly 15, 20, 30, 40, 50, and 60 km/h
To illustrate how the vehicle speed is calculated while in ROI, and for each speed we use 3 different camera angles there
we give an example in Fig. 7 and Fig. 8 that shows object are 45, 50, and 60 degrees so there are 18 data which to be
position in frame t and t + 1 respectively. Then, we calculate executed and to be validation data for the system in this paper.
the distance using Euclidean distance given by Fig. 9. Validation process in this paper is derived from relative error
calculation between estimated average speed and real average
speed of vehicle.

B. Experiment Result
As described before, video input data is extracted to frames
and then each frame is processed firstly by preprocessing.
Preprocessing is used to minimize solid shadow that can be
Fig. 7. Object at frame t. Left : a real object in video data. Middle : result detected as object in background subtraction process. We use
of object detection in image processing. Right : bounding box and centroid
of the object contrast and brightness adjustment to do preprocessing. The
result for this process is given by Fig. 10 which show that with
preprocessing, we can get better result for object detection, the
word ”better” in this paper means that shadow is not detected
as object. After preprocessing and background subtraction

Fig. 8. Object at frame t + 1. Left : a real object in video data. Middle : result
of object detection in image processing. Right : bounding box and centroid
of the object

Fig. 10. Preprocessing Result on Background Subtraction GMM. Top :


without preprocessing. Bottom : with preprocessing.

using GMM process, then foreground image generated from


GMM is processed by smoothing to remove noise. Result for
smoothing process is given by Fig. 11. The next step is shadow
removal which map the image into binary image (only contain
1 and 0) using Equation 6. Result for shadow removal process
is given by Fig. 12. The image result from shadow removal
Fig. 9. Illustration for Vehicle Speed Estimation from given example at Fig.
7 and Fig. 8. process can contain many gaps inside the object which can
split one object into separate objects, so that it is needed to
With given known parameters there are image size reconstruct the image using morphological closing operation.
320x240, f ps = 30, Tv = 60,p Tc = 41.10, and H = 7.6, Result for morphological closing operation is given by Fig.
then we can calculate d = (5.5 − 3.5)2 + (7 − 5)2 ≈ 2.83 13. After this process, we can do object detection process
1
pixels, t = 30 = 0.033s, D = 7.6 tan(80.55) = 45.661 meters, using connected component and estimate speed for the object
WICAKSONO et al.: SPEED ESTIMATION ON MOVING VEHICLE BASED ON DIGITAL IMAGE PROCESSING 25

which is given by Fig. 14 and Fig. 15 respectively. To integrate


all processes together, we create an GUI interface in Java
Programming to ease us to do experiment. GUI interface for
the system in this paper is given by Fig. 16.

Fig. 15. Speed Estimation Result. Left : before speed estimation. Right : after
speed estimation

Fig. 11. Smoothing Result. Left : before smoothing. Right : after smoothing

Fig. 12. Shadow Removal Result. Left : before shadow removal. Right : after Fig. 16. System Interface
shadow removal

from Fig. 18, the best ROI region for 60 degree is full region,
for 50 degree is medium to fast region, and for 45 degree is
same as 50 degree’s. Then this result will be a reference to do
experiment using complete video data in the next.

Fig. 13. Morphology Closing Result. Left : before operation. Right : after
operation

Fig. 17. ROI Regions


Fig. 14. Object Detection Result. Left : before object detection. Right : after
object detection

Region of Interest (ROI) selection for this camera position


and using Euclidean distance to calculate the distance traveled
by the object is important to be checked further, because as
we can see in real view, if our eyes were the camera above
highway, the object that come toward us will come slightly
faster as well as the object come nearer from camera. So with
this perspective, we can draw three regions of video captured,
there are slow, medium, and fast region, marked by color red,
green, and yellow respectively, that is given by Fig. 17. To test
the best ROI region to be selected in experiment section based
on camera angle, we use three data from one same speed with
three different camera angle to determine which is the best
region for each camera angle. Result for testing ROI selection Fig. 18. ROI Selection for Speed Estimation Result
is given by chart in Fig. 18. The result that can be derived
26 INTERNATIONAL JOURNAL OF COMPUTING SCIENCE AND APPLIED MATHEMATICS, VOL. 3, NO. 1, FEBRUARY 2017

C. Data Tables high accuracy for high speed, and camera angle 50 degree
The detail about video data that is used in this paper is gives high accuracy for medium speed, and camera angle
described at Table 1. Each video data has detail information 45 degree gives high accuracy for slow speed.
about f ps, Tv , Tc , H, and known speed of the vehicle. For • The highest error for speed estimation in this system is
example, video data’s name ”dtc-15-60d” means that the video speed estimation on high speed vehicle.
is taken place at DTC which vehicle speed is 15 km/h and • There are still many problems on object detection method
camera angle 60 degree. Notation Ve is estimated speed which which is still be an open problem, for example : two
is result from the system and Errr is relative error from real vehicles are near each other will be detected as one object.
speed and estimated speed in percentage (%). Then, we can Problem on object detection process will affect speed
estimation accuracy because the centroid point is depend
TABLE I on object detection result.
V IDEO DATA
V. C ONCLUSIONS
No Video Name f ps Tv Tc H Ve Errr Speed estimation is one of many important parts of Intelli-
1. dtc-15-60d.avi 30 60 41.10 7.6 16.335 8.9
gent Traffic System (ITS) which can be done by using image
2. dtc-20-60d.avi 30 60 41,10 7.6 21.424 7.12
3. dtc-30-60d.avi 30 60 41.10 7.6 31.884 6.28 processing technique. It is more efficient and economical than
4. dtc-40-60d.avi 30 60 41.10 7.6 38.520 3.7 conventional technique without using image processing, for
5. dtc-50-60d.avi 30 60 41.10 7.6 48.632 2.74 example : using speed radar and manual inspection. Research
6. dtc-60-60d.avi 30 60 41.10 7.6 53.487 10.86
7. dtc-15-50d.avi 30 50 41.10 7.6 15.874 5.83
in this paper is a complement for other researches which
8. dtc-20-50d.avi 30 50 41.10 7.6 21.154 5.77 are discussed the same topic in which this paper shows that
9. dtc-30-50d.avi 30 50 41.10 7.6 31.201 4.0 there is an influence between speed estimation, camera angle,
10. dtc-40-50d.avi 30 50 41.10 7.6 38.348 4.13 and ROI selection while using Euclidean distance. So that,
11. dtc-50-50d.avi 30 50 41.10 7.6 48.446 3.11
12. dtc-60-50d.avi 30 50 41.10 7.6 53.807 10.32 this paper can be a reference for further researches about
13. dtc-15-45d.avi 30 45 41.10 7.6 15.346 2.3 speed estimation on moving vehicle using image processing
14. dtc-20-45d.avi 30 45 41.10 7.6 20.124 0.62 and Euclidean distance. The system in this paper acts as
15. dtc-30-45d.avi 30 45 41.10 7.6 27.934 6.88
16. dtc-40-45d.avi 30 45 41.10 7.6 36.922 7.7
prototype which can be more developed and be more complex
17. dtc-50-45d.avi 30 45 41.10 7.6 46.192 7.62 for larger system to build a complete ITS system for smart city
18. dtc-60-45d.avi 30 45 41.10 7.6 52.201 12.99 development.

calculate accuracy Acc in percentage from relative error by R EFERENCES


using Equation 13 and the result for accuracy is given by Fig. [1] B. C. Putra, “Moving vehicle classification with fuzzy logic based
19. on image processing,” Master’s thesis, Sepuluh Nopember Institute of
Technology, 2016.
Acc = 100 − Errr (13) [2] B. Setiyono, D. R. Sulistyaningrum, I. Mukhlash, and R. A. J. Firdaus, “A
new approach algorithm for counting of vehicles moving based on image
processing,” International Journal of Computer Science and Information
Security, vol. 14, no. 10, pp. 366–370, 2016.
[3] A. G. Rad, A. Dehghani, and M. R. Karim, “Vehicle speed detection
in video image sequences using cvs method,” International Journal of
Physical Sciences, vol. 5, no. 17, pp. 2555–2563, 2010.
[4] J. Lan, J. Li, G. Hu, B. Ran, and L. Wang, “Vehicle speed measurement
based on gray constraint optical flow algorithm,” Optik-International
Journal for Light and Electron Optics, vol. 125, no. 1, pp. 289–295,
2014.
[5] H. Sundoro and A. Harjoko, “Vehicle counting and vehicle speed mea-
surement based on video processing,” Journal of Theoretical and Applied
Information Technology, vol. 84, no. 2, pp. 233–241, 2016.
[6] A. Khan, I. Ansari, M. S. Z. Sarker, and S. Rayamajhi, “Speed estimation
of vehicle in intelligent traffic surveillance system using video image
processing,” International Journal of Scientific & Engineering Research,
vol. 5, no. 12, pp. 1384–1390, 2014.
[7] R. C. Gonzalez and R. E. Woods, Image processing. Prentice Hall, 2007.
Fig. 19. Accuracy of Speed Estimation based on Camera View Angle

D. Evaluation
• The accuracy result for speed estimation is satisfied with
minimum 87.01% and maximum 99.38%.
• If we categorize our own data to be three categories which
are slow speed : 15 km/h and 20 km/h, medium speed
: 30 km/h and 40 km/h, and high speed : 50 km/h and
60 km/h, we can see that camera angle 60 degree gives

View publication stats

You might also like