Speed Estimation On Moving Vehicle Based On Digital Image Processing
Speed Estimation On Moving Vehicle Based On Digital Image Processing
net/publication/317312246
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:
All content following this page was uploaded by Budi Setiyono on 29 September 2017.
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
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.
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
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. 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
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.
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