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

Shadowed Lane

Shadow lane + Matlab Algorithm

Uploaded by

Ashutosh Pandey
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)
42 views7 pages

Shadowed Lane

Shadow lane + Matlab Algorithm

Uploaded by

Ashutosh Pandey
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

Open Journal of Applied Sciences, 2013, 3, 68-74

Published Online March 2013 (http://www.scirp.org/journal/ojapps)

Robust Lane Detection in Shadows and Low Illumination


Conditions using Local Gradient Features
Avishek Parajuli, Mehmet Celenk, H. Bryan Riley

School of Electrical Engineering and Computer Science Stocker Center, Ohio University Athens, Ohio USA
Email: {ap356311, celenk, rileyh1}@ohio.edu
Received 2012

ABSTRACT
This paper presents a method for lane boundaries detection which is not affected by the shadows, illumination and uneven road conditions. This method is based upon processing grayscale images using local gradient features, characteristic spectrum of lanes, and linear prediction. Firstly, points on the adjacent right and left lane are recognized using the
local gradient descriptors. A simple linear prediction model is deployed to predict the direction of lane markers. The
contribution of this paper is the use of vertical gradient image without converting into binary image(using suitable threshold), and introduction of characteristic lane gradient spectrum within the local window to locate the preciselane
marking points along the horizontal scan line over the image. Experimental results show that this method has greater
tolerance to shadows and low illumination conditions. A comparison is drawn between this method and recent methods
reported in the literature.
Keywords: Local Gradient Features; Lane Detection; Linear Prediction; Characteristic Spectrum

1. Introduction
Lane detection has long been an important area of research for people in autonomous vehicle systems. There
are a large number of lane detection algorithms that are
available in the literature during recent years [1-8]. The
lane detection algorithm can be classified in two broad
categories, namely model based [8,13-18] and feature
based [1,7,11,12].The Model-based lane detection system
begins with selecting a model/template for lane, extracting parameters to represent lanes, and fitting the model to
the extracted parameters and processing. Applications of
these template based methods (linear, spline, parabola)
are limited to some road environments and cannot perform well in the presence of shadows and low illumination condition. The algorithm proposed by Yue et al. [15]
used the cubic B- snake to model the lane boundaries.
The use of Canny Hough Estimation of Vanishing Points
(CHEVP) algorithm for locating the initial points is sensitive to choice of threshold. Moreover, this method is
vulnerable to presence of shadows and illumination condition.
The most common and simple technique for detecting
road markings is based on Image gradient or edges (feature based). McDonald and Palmer et al. presented methods based on detecting edges and applying Hough
Transform in [11], [12] respectively. However these edge
methods are sensitive to illumination, heavily affected by
shadows, environmental conditions. Additionally, these

Copyright 2013 SciRes.

methods have experienced difficulties when choosing a


suitable intensity threshold to remove the unwanted
edges. In [6], a layered approach is presented for robust
lane detection at night which relies on temporal frame
averaging, edge detection and Hough transform. The
algorithm is very fast, robust, and can be used in real
time applications. However, it is susceptible to lighting,
shadows, and environment conditions and focuses only
on straight road segments.
The authors in [3] presented a method which combines
input from multiple cameras (data fusion) and line models are formed from feature points using a RANSAC algorithm. The approach is fast and robust; however, it can
support real time operation only at low speeds, and is
heavily affected by the presence of cars and other obstacles on the road, resulting in generation of false feature points. There have been efforts by C. Rasmussen in
[4] to use Principal Component Analysis (PCA) for lane
detection where they use gradient within a local window
to obtain the vanishing point, but the directions obtained
from gradients of PCA may not converge all the time.
The algorithm in [19, 22] presented the Likelihood of
Image Shape (LOIS) lane detection system that applies
likelihood function into lane marker detections. Lane
finding in ANother domAin (LANA) [20] uses sets of
frequency domain features to capture information concerning the strength and orientation of spatial edges.
LANA is similar to LOIS in detection stages but differs
only in the use of frequency features of lanes while LOIS
OJAppS

69

A. PARAJULI

uses spatial edge features. The algorithm presented herein, also uses the frequency features of the lane markings
that are a characteristic representation of the lane.
Sivaraman et al. presented a method in [15] for lane
detection and tracking in high density traffic scenes using
vehicle localization where lane detection and tracking is
performed by using steerable filters and Kalman filters.
The algorithm in [15]performs well only in high density
traffic scenes but its performance degrades highly in an
empty road. Also good performance of this method in
presence of shadows is doubtable. The research presented in [10] also fails to perform well in presence of
shadows.
A survey of the recent lane detection methods are presented in [9, 10]. There has been progress in detection of
lanes of various shapes but there is a need for robust detection of lanes in presence of shadows and other image
artifacts. The work presented in [7] performs well in
presence of shadows but cannot track the curved sections
of the road in the far field of the image. The work presented here is compared with the work[7] using the same
datasets [23].The remaining sections of this paper are
organized as follows. Section 2 contains the description
of method and path chosen. Section 3 presents the experimental results. The conclusion and suggestions for future work are presented in section 4.

ET

AL.

and w5. Then the magnitude of FT (Fourier Transform)


of these five matrices is computed and their average is
calculated. This average value of the magnitude of FT is
the characteristic spectra for the lane markings and will
be represented as Lspectra. The variable Lspectra used
further in this discussion will refer to the characteristic
spectra of the lane markers. This process of obtaining
characteristic spectra for a point s1 is shown in Fig. 2.

2. Description of the method


The proposed method begins with extracting the individual frames from the video and processing each frame
to detect and track the road lane markers. Then the vertical gradient of the image is calculated and processing is
done in this vertical gradient image. The vertical gradient
is selected to remove the effects of shadows along the
road which are usually horizontal.Additionally, this method does not require threshold to convert the gradient
image into binary image and is thus unaffected by illumination conditions and shadows.

Figure 1: Characteristic spectra of the left lane markers at point s1, s2,
s3, s4, s5 and the average spectra.

2.1. Feature extraction


The vertical gradient of an image [21]is obtained by 2D
discrete convolution of an image I (m, n) with h (m, n)

G ( m, n ) = I ( m, n ) * h(m, n)
where h (m, n) is a mask given by
1 1 1
h ( m, n ) = 0 0 0
1 1 1

(1a)
Figure 2: Graphical representation for the process of obtaining characteristic spectra.

(1b)

In the spatial domain, a window of size 15x15 is selected


and placed at randomly selected points s1, s2, s3, s4, and
s5. All the points within these five local windows are
placed in five different matrices namely w1,w2, w3, w4
Copyright 2013 SciRes.

Analysis of result for different window dimension indicated the 15x15 size window produced most consistent
and accurate representation of distinguishing road lane
markers from background settings.The spectra for the
lane markings are characteristic to the respective lane
and invariant to the selection of location on a given lane
marking (independent of translation, rotation and scalOJAppS

70

A. PARAJULI

ET

AL.

ing).The characteristic spectrum is obtained from the first


frame of the video file from the image database[23]. This
spectrum (Lspectra) is consistent for all the images of the
video file from the database. Once the characteristic
spectrum of lane marking is obtained from the first frame
of the, we do not require to obtain the characteristic
spectra from all the successive frames for a period of
time.

2.2. Gradient spectrum match function


The gradient spectrum match function is used to locate
the precise points on the adjacent lanes in which the vehicle is moving. The 15x15 local window is moved along
the horizontal scan line (see Figure 3) and magnitude of
FT over the local window is calculated as represented in
Equations 2-4. Let I ( n1 , n2 ) be the gradient image
(see Figure 3) with the following dimensions.

I ( n1 , n2 ) , n1 , n2 are discrete variables in the range


1 n1 R,1 n2 C

(2)

The sliding window is placed at each point along the


horizontal scan line (green colored line in Figure 3)and
corresponding gradient values of image I ( n
, n ) within
the window can be represented by variable p as in the
Equation 3. Along the horizontal line the row component
of the image i.e. yp ( i ) = y ( i ) is fixed and only the n 2
changes along the scan line from 1 to C.
p = I ( n
+ k, n + l )

(3)

7 k 7, 7 l 7

P
= FT { p=
+ k , n + l )}
} FT {I ( n

(4)

Then the variable P = FT { p} generated at a given


point ( n
, n ) is correlated with the characteristic spectrum Lspectra and the maximum value is chosen. This
maximum value is R (0, 0) and can be obtained by element wise multiplication of Lspectra and P as shown in
Equation 5. The maximum correlation is calculated at
each point along the horizontal scan line (refer to Figure
3) and stored in a variable Sm ( n) where n= 1,
2,..C.
The normalized plot of Sm for all the values of
along the horizontal line is called Spectrum matching
plot (Figure 3).
j = 77
R(0, 0) = i =7 Lspectra ( i, j ), P ( i j )
(5)
i = 7
= 1, 2, 3 C (6)
Sm(n2) =R (0, 0), where n

2.3. Processing of spectrum match (Sm) plot

The spectrum matching plot (Sm) is smoothed with a


Moving Average (MA) filter of order 20, and the maxima points on the plot are found using the algorithm
in[24].To remove the unnecessary processing of maxima
Copyright 2013 SciRes.

Figure 3: Spectrum matching (Sm) plot generated along the horizontal


scan line on the gradient image. Filtered version of spectrum matching
plot with green points representing maxima points in extreme right.

points, the Sm plot is threshold by a suitable value of


0.3(if Sm(i) < 0.3, thenSm(i) = 0). This choice of this
threshold value is not critical and helps only in the removal of unnecessary maxima points.

2.4. Local Maxima Discrimination Via Bayesian


Classifier
The local maxima points obtained in the Sm plot is decided as either belonging to the left or right. Bayesian
classifier is devised to discriminate the maxima points
into one of the two designated classes, namely, left line
class(CL), and right line class(CR)[22]. The maxima
points which lies on the left of the median line (line
passing through the median of column number) is decided as belonging to left lane class CL, and the maxima
points to the right of median line as designated as right
lane class CR. Let X be the vector containing all the
=median(C),
column number of maxima points and
where C is the Column of the image shown in Figure 3.
If Xi then Xi CL
If Xi then Xi CR

(7)
(8)
OJAppS

71

A. PARAJULI

ET

AL.

where i =1, 2 N; N=total number of local maxima.


The Figure 3 shows the first horizontal scan line which
is set to start from at 3/4th of the length of the image
(0.75R). The second scan line will start at 5 pixel points
above the first line and so on. The first scan line has only
one maxima points at x= 60 (N=1). This point is classified as CL, because Equation. 7 is satisfied. The median
for all the images obtained from the database [23] is con=256/2 + 1 = 129).
stant (
Figure 4 shows an instance in which three scan line,
separated by 50 pixels, are produced and the spectrum
matching plot Sm is generated for each of the three horizontal lines. The Sm plot from scan line 1 has only one
maxima point that belongs to left class (CL) as that points
lies to the left of medina line. The scan line 2 intersects
with both the adjacent left lane and right lane markers
and it is reflected in the corresponding Sm plot with two
maxima points on the either side of median line. The Sm
plot for the scan line 3 has four maxima points with the
left one belonging to the class CL and the other three belongs to class CR. In the near field of the image, the Sm
plot along the scan line produces less maxima points. As
the scan line is mover further into the far field the number of maxima points increase. The maxima points are
classified into one of the two classes.
For all the scan lines separated by a distance of 5
pixels, the left and right lane points are selected as maximum values in respective class; i.e,
LT=max (CL)

(9)

RT=max (CR)

(10)

Due to the effect of filtering, the maxima points are


shifted away from their true location in the Sm plot.
Therefore the precise locations of the lane markers are
found by searching the pixel with maximum intensity in
the neighborhood of the points obtained from Equation 9
and Equation 10 along the respective horizontal line. It
was found that searching for the maximum intensity in
the spatial domain of the gray scale image produced better results than searching in the vertical gradient of the
image. Mathematically, it is represented in Equation 11
and 12.
LT= max{img(row,LT-20:LT+20)}

(11)

RT=max{img(row,RT-20:RT+20)}

(12)

where row is the row number for a given scan line, and
img (row, column) is the original gray scale image.
After the first five left and right lane points are determined, next left and right lane points are predicted based
on the last five left and right points, respectively. The
prediction scheme is described in the next section and is
useful in removing the false lane points obtained from
the maxima points of Sm plot.

Copyright 2013 SciRes.

Figure 4: Image gradient with three scan lines and their respective Sm
plots with maxima points. The maxima points are represented by green
dots on the lower portion of Figure and the median line by yellow and
red line.The distance between the scan lines is set to 50 pixels in this
Figure for the purpose of simplifying the explanation of process. The
distance between the scan lines in the actual algorithm is set to 5. Red
line is the median line.

2.5. Linear prediction of lane points


After the first five horizontal scan lines are drawn, the
left and right lane points on the next scan line are estimated using a simple linear prediction model. Since the
distance between the scan lines are predetermined and
fixed in advance, the row number for each horizontal line
is known. Let y1, y2, y3, y4, and y5 be the column number of five lane marking points. The 1D displacement
d ( i ) , between the five points is calculated and their
mean value is computed. The next predicted point is then
calculated by adding the mean displacement of last five
to the most recent point y5. The process described here is
presented in Equations 13 -16.
(13)
Predicted points, yp ( i ) = y ( i ) ; i=1,2, 5s
Displacement,

d ( i=
) yp ( i + 1) yp ( i ) ;

where i = 1, 2, 3, 4.

(14)

d (i )

i =14

Mean displacement,

D=

4
Predicted point, yp (6) = yp (5) + D

(15)
(16)

2.6. Error Correction


OJAppS

72

A. PARAJULI

ET

AL.

The estimated points yp (i ) for the next scan line are


compared with the calculated lane points, y ( i ) of the
next scan line for both left and right lane points. If the
computed point y ( i ) deviates very far away from the
predicted point yp (i ) an error has occurred in the
computation of the actual lane marking points. In such
cases the predicted point is selected as correct point. All
these steps are shown in Equation 17.
If abs {}> threshold, then

else

end.(17)

y ( i ) = yp ( i )
yp ( i ) = y ( i ) s

where the empirically determined threshold is set to 20.


Figure 5 shows the calculated points and their predicted
values. The linearly predicted points after error correction yields highly accurate representation of the precise
location of the lane markings.
A 2D graph showing the comparison of computed lane
points with the predicted and corrected points is shown in
Figure 6. The processing steps outlined through sections
2.2 through 2.6 are performed for an image until both the
left and right lane marking point falls to the same class.
That is, algorithm stops when both the lane points lies on
the same side of the median line(same class).

Figure 6: Comparison of the computed and predicted &


corrected lane marking points as a function of row and
column number.

3. Results
This section, presents the results obtained from the
process described in section 2. The various stages of
feature extraction, generation of spectrum matching plot,
discrimination via Bayesian learning, and linear
prediction of lane points are implemented using a laptop
computer with a clock rate of 2.24 GHz executing
Matlab software version R2008a. The data sets of images
used for the testing and validation of the proposed
method is same as that has been used in [cmu].
(http://vasc.ri.cmu.edu/idb/html/road/may30_90/). The
157 image sequence was tested with our algorithm and it
was found that 150 images were successfully detected
with 7 false detections. The succesfully detection rate
was found to be 95.54 % which are better than the
detection rate achieved in [7,15].
Some of the results of lane marker detection in presence of shadows are presented in Figure 7-8. The presence of error correction scheme in the algorithm rectifies
the large deviations from the lane markers position as the
lane markers do not change its course abruptly. An important advantage/contribution of this method is to track
roads lane markers of various shape (curved or straight)
and locate precise lane marking points on each horizontal
scan line which is not affected by presence of shadows
and other low illumination condition. This method has a
disadvantage in that the first five scan line needs to locate almost precise points because the error in the first
five scan lines cannot be corrected. It was found that any
high dynamic range portion of image leading to errors in
the first five scan lines cannot be rectified.

Figure 5. Computed lane markings(blue colored box), and


predicted markings(red color dots) plot on the vertical gradient image and RGB image. Note the presence of shadows.

Copyright 2013 SciRes.

OJAppS

73

A. PARAJULI

Figure 7: Experimental results for some of the extreme cases of illumination and road conditions. Note that even thepresence of shadows and vehicle on the lane markers has
little to no affect the detection results.

Copyright 2013 SciRes.

ET

AL.

Figure 8: Some additional experimental results.

OJAppS

74

A. PARAJULI

4. Conclusion
This paper has introduced an approach for the detection
of road lane markers based on local gradient features,
characteristic lane spectrum, and spectrum match plot
(Sm). Further the linear prediction and error correction
schemes leads to robust detection of lane marking points
along the scan line. The experimental result suggest that
this method is robust for lane detection in presence of
shadows and other vehicles.
The future extension of this work can be information
fusion of this method and other methods (e.g. Hough
transform)for higher detection rate in other inclement
weather conditions such as rain, snow, fog. Nevertheless, there is always room for improvement.

REFERENCES

ET

AL.
mation and tracking for driver assistance: survey, system,
and evaluation, IEEE Transactions on Intelligent Transportation Systems, vol. 7, no. 1, pp. 2037, 2006.

[10] A. Bar Hillel, R. Lerner, D. Levi, and G. Raz, Recent


progress in road and lane detection: a survey, Machine
Vision and Applications. In press. View at
r View at Google Scholar
[11] J McDonald. Detecting and tracking road markings using the Hough transform, Proc. Of the Irish Machine Vision and Image Processing Conference 2001.
[12] P. L. Palmer, J. Kittler and M. Petrou, An optimizing
line finder using a Hough transform algorithm, Computer Vision and Image Understanding, vol. 68, no 1, pp.
1-23, July 1993.
[13] K. Kluge and S. Lakshmanan, A deformable-template
approach to lane detection, Proceedings of the Intelligent
Vehicles '95 Symposium, pp. 54-59, September 1995
[14] Y. Wang, et al., Lane detection using spline model,
Pattern Recognition Letters, vol 21, pp.677-689, 2000.

[1]

Y. Wang, N. Dahnoun, and A. Achim, A novel system


for robust lane detection and tracking, Signal Processing,
vol. 92, no. 2, pp. 319334, 2012. View at
Publisher View at Google Scholar.

[2]

Z. Kim, Robust lane detection and tracking in challenging scenarios, IEEE Transactions on Intelligent Transportation Systems, vol. 9, no. 1, pp. 1626, 2008.view.

[16] J. W. Park, et al., A lane-curve detection based on LCF,


Pattern Recognition Letters, vol 24, pp.2301-2313, 2003.
view

[3]

C. Lipski et.al. A fast and robust approach to lane marking detection and lane tracking in proceedings of IEEE
SSIAI, 24-26 march 2008.view

[4]

C. Rasmussen,Groupingdominat structure of Ill structured Road Following in proceedings of IEEE computer


society, CVPR 2004 27 June-2 July 2004, pages I-470 I-477 Vol.1

[17] Dong-Joongkang and Mun-Ho Jung,Road lane segmentation using dynamic programming for active safety vehicles, Pattern Recognition Letters, vol 24, pp
3177-3185, July 2003.

[5]

S. Sivaraman and M. M. Trivedi Improved vision-based


lane tracker performance using vehicle localization in
proceedings of IEEE intelligent vehicles symposium,
June 21-24, 2010. view

[6]

A. Borkar et.al. A layered approach to robust lane


detection at night in proceedings of IEEE CIVVS,
March 30-April 2 , 2009

[7]

Y. Fan, W. Zhang, X. Li, L. Zhang, and Z. Cheng A


robust lane boundaries detection algorithm based on gradient distribution features, Proceedings of the 8th International conference on Fuzzy Systems and Knowledge
Discovery (FSKD), pp 1714-1718, July 2011.

[8]

[9]

J. Wang, F. Gu, C. Zhang, and G. Zhang Lane boundary


detection based on parabola method, Proceedings of the
2010 IEEE, International conference on Information and
Automation, pp 1729-1734, china, June 2010.view
J. C. McCall and M. M. Trivedi, Video-based lane esti-

Copyright 2013 SciRes.

[15] Y. Wang, et al., Lane detection and tracking using


B-Snake, Image and Vision Computing, vol. 22,
pp.269-280, 2004.

[18] S.P.Liou, R.C. Jain, Road following using vanishing


points, Computer Vision, Graphics, and Image
Processing 39 (1987) 116-130.
[19] S. Lakshmanan and K. Kluge, LOIS: A real-time lane
detection algorithm, in Proceedings 30th Annual Conference of Information Science Systems, 1996,
pp.10071012.
[20] C. Kreucher and S. Lakshmanan, LANA: A lane extraction algorithm that uses frequency domain features,
IEEE Transactions on Robotics and Automation, vol. 15,
no. 2, pp.343-350, April 1999.
[21] J.S. Lim, Two Dimensional Signal and Image Processing,
Prentice Hall 1990.
[22] S. Theodoridis and K. Koutroumbas, Pattern Recognition,
3rd ed. New York: Academic, Feb. 2006.
[23] Carnegie-Mellon-University, CMU/VASC image database19972003, link
[24] Carlos.Aguilera, Finding local Extrema in Matlab
(http://blogs.mathworks.com/pick/2008/05/09/finding-loc
al-extrema), link to matlab files.

OJAppS

You might also like