Professional Documents
Culture Documents
A Novel Algorithm For Estimating Vehicle Speed From Two Consecutive Images
A Novel Algorithm For Estimating Vehicle Speed From Two Consecutive Images
A Novel Algorithm For Estimating Vehicle Speed From Two Consecutive Images
use. Another limitation is that these methods are coordinates using camera parameters calculated from
usually based on a sequence of video images: for lane-marking calibration [16]. As there is no height
updating background reference [14] or computing information immediately available from the two
forward and backward differences between the frames images, only the X-Y plane in 3D is considered for all
for motion tracking [15]. The errors due to day-night subsequent estimation. From the two reconstructed
transition or general weather changes could be large images, an image differencing is applied so that the
unless updating is frequent enough, which needs to two vehicles are overlaid on one resultant image.
trade-off with computational complexity. Actually, in Although this can effectively remove the background
most road safety systems, vehicle speed is monitored features as the time difference between the two images
by radar or other non-visual sensors, and then two is small, it also resulted in a large amount of noise and
high quality consecutive images are captured when holes along the boundaries of the vehicles. These are
speeding is detected. In these systems, although traffic removed by a carefully selected threshold and
video may be available which are of low resolution, an morphological operations to obtain a combined
automatic vehicle speed estimation method from the vehicle mask. After that, a block matching algorithm is
two high quality consecutive images is therefore a applied, which includes specifying the block and
logical choice. If speed estimation can be calculated matching it within a search window. As the 3D X-Y
from two images, then it would be trivial to do the plane is given in physical dimension (meters in this
same from an image sequence. For these reasons, we case), the distance between the two matched blocks
propose a new two-images-based vehicle speed denotes the distance traveled by the vehicle between
estimation algorithm in this paper, which can be the two consecutive images. Speed is then estimated
compared with the speed measured by a Doppler by taking this value and dividing it by the time taken
speed radar system operating at 34.3 GHz for between the two images.
referencing. Compare with video-based algorithms,
the proposed algorithm is fast, needs less storage, and 2.2. 2D to 3D transformation
is reasonably accurate.
This paper is organized as follows: detailed The purpose of camera calibration is to establish a
approach is presented in Section 2, experiment results relationship between the 3-D world coordinates and
are depicted in Section 3, and conclusion is drawn in the corresponding 2-D image coordinates. In this
Section 4. paper, we adopt the camera model proposed in [16]
and [17], which is depicted in Fig. 2. In essence, this
2. Proposed Algorithm model describes all the extrinsic parameters (camera
height h, pan angle p, tilt angle t and swing angle s)
2.1. General principle and an intrinsic parameter (focal length, f). The
definitions of these parameters are: Pan angle is the
The block diagram of the proposed algorithm is horizontal angle from the Y axis of the world
depicted in Fig. 1. To begin with, the two consecutive coordinate system to the projection of the optical axis
images taken through a perspective view are of the camera on the X-Y plane measured in the
transformed from their 2D image plane to 3D world anti-clockwise direction. Tilt angle is the vertical angle
f s
y x era
cam
t
.q
ne
la
(a) Original 1st image
ep
ag
im
p . Q h
Y
world plane
X
(b) Original 1st image (c)-(d) Reconstructed images of (a)&(b)
Figure 2. Perspective camera model on X-Y plane respectively.
Figure 3. Transform 2-D image to X-Y plane in 3-D.
of the optical axis of the camera with respect to the
X-Y plane of the world coordinate system. Swing in X-Y plane can be reconstructed, as depicted in Fig.
angle is the rotational angle of the camera along its 3(c) and 3(d). Since both Fig. 3(c) and 3(d) represent
optical axis. Focal length is the distance from the the view along the Z-axis perpendicular to the road
image plane to the center of the camera lens along the plane, the distance traversed by the vehicle from 3(c)
optical axis of the camera, while camera height is the to 3(d) represents the actual distance traveled.
perpendicular distance from the center of the camera However, it should be noted that this is only true for
lens to the X-Y plane. These parameters can be points on the road plane. Other points that are not on
estimated using existing road lane markings without the road plane do not represent the same as height
having to measure them physically [16]. Without information is not available. Therefore, the problem in
detailed derivation, the mapping between the image matching is not finding the most correlated blocks
plane and world plane is quoted below. between the two vehicle images as in [10] and [12],
Let Q=(XQ,YQ,ZQ) be an arbitrary point in the 3-D but to make sure that the feature points in the block
world coordinate and q=(xq,yq) be the corresponding are on the road surface as well. The most reliable
2-D image coordinates of Q. A forward mapping points in these images for the purpose are the points
function, which defines the transformation from a where the wheels touch the ground. Unfortunately,
point in the world coordinates to a point in the image these points are extremely difficult to be determined.
coordinates is given as, For the reason, our subsequent estimation is based on
⎡ X Q (cos p cos s + sin p sin t sin s ) ⎤ the shadow of the back bumper that casts on the
⎢ ⎥
f ⎢+ YQ (sin p cos s − cos p sin t sin s )⎥ ground. Although this feature is relatively easy to find,
⎢+ Z cos t sin s ⎥ and
xq = ⎣ Q ⎦ , this is also represents a source of error due to road
− X Q sin p cos t + YQ cos p cos t + Z Q sin t + h / sin t
color change, illumination change and shadow.
⎡ X Q (− cos p sin s + sin p sin t cos s ) ⎤
⎢ ⎥
f ⎢+ YQ (− sin p sin s − cos p sin t cos s )⎥ 2.3. Vehicle Mask Overlay
⎢+ Z cos t cos s ⎥
yq = ⎣ Q ⎦ .
− X Q sin p cos t + YQ cos p cos t + Z Q sin t + h / sin t
If a background reference image is available, we
If point Q lies on the X-Y plane, ZQ is zero, and XQ can easily extract the vehicle masks of each image and
and YQ can be calculated from (xq,yq) as: estimate the vehicle position directly [18], [19]. On the
⎡h sin p (x sin s + y cos s ) sin t ⎤
q q ⎡− h cos p (x sin s + y cos s ) sin t ⎤ q q premise that no background reference image is
⎢ ⎥ ⎢ ⎥
XQ = ⎣⎢+ h cos p (x cos s − y sin s ) ⎦⎥
q q ⎣⎢+ h sin p (x cos s − y sin s )
, YQ = ⎦⎥q q
.
available, we regard one of the two images as a
xq cos t sin s + yq cos t cos s + f sin t xq cos t sin s + yq cos t cos s + f sin t
background reference, then perform conventional
Equations (1-4) define the transformation between vehicle mask extraction on the other image and finally
the world and image coordinates. get an overlaid vehicle mask. In this paper, a simple
Given an image as depicted in Fig. 3(a), lane vehicle mask extraction method was adopted, which
markings that form a parallelogram [16] can be used includes three steps: temporal differencing,
to estimate the camera parameters, from which thresholding and morphological operations.
Equations (1-4) can be solved. In other words, every First, we overlay one image onto the other by
pixel of the two consecutive images can be taking an absolute difference between the two images.
transformed to the 3D coordinates (with Z=0) using This results in the image as depicted in Fig. 4(a). For
Equations (3) and (4), and the corresponding images color images, we obtain the absolute difference in each
Speed (km/h)
Estimated speed
90
60
30
0
1 5 10 15 20 25 30
(a) Test examples in daytime
150
120 Speed from radar
Speed (km/h)
Estimated speed
90
60
30
0
1 5 10 15 20 25 30
(b) Test examples in nighttime
Figure 7. Travel distance estimation Figure 8. Estimated speed compared with radar
measured speed
the two blobs are merged as in Fig. 5(d), it is not
possible to calculate the estimated displacement, where R is the resolution of reconstructed images, t is
therefore, we have to search the best matching block the time interval between the two images, and v is the
in a larger search window of [2sx+2k +(dmax-dmin)]× estimated speed.
(2sy+w), where dmax and dmin are maximum and
minimum displacement respectively which are derived 3. Experimental results and analysis
from prior knowledge such as theoretic maximum and
minimum speed of the vehicle. Consider that In this experiment, we evaluate the accuracy of the
illumination condition across images may vary (due to proposed method in estimating individual vehicle
flash, shadow of building, etc.), and that lane markings speed from real traffic images at day-time as well as
may affect the matching, we normalize the blocks by night-time, by comparing the estimated value with the
enhancing their contrast and saturating the high speed measured by a Doppler speed radar system. All
intensities part of them, as shown in Fig. 7, before the test images are taken by a surveillance camera at
calculating MAD. 0.5 seconds apart, with the size of 1280×1024 and 24
Once a block is matched, traveled distance in pixels, bit color depth mode. We first calculate the
PD, of the vehicle between the two images is reconstructed images as described in Section 2.2 with
represented by the distance between the source block resolution of 10 pixels/meter, and then threshold the
and the matched block. Vehicle speed is the distance 256 gray level frame difference using a threshold of 30
traveled normalized to physical distance in meters, and to generate the vehicle mask. k, sx and sy in block
divided by the time taken to traverse that distance, matching period were set to 10 pixels, 20 pixels and
which is given by: 10 pixels respectively.
PD / R , For the 31 sets of day-time images, the results
v=
t estimated by the proposed method and reference speed