Real-time lane departure warning system based on a single FPGA
-
Xiangjing An,
-
Erke ShangEmail
author,
-
Jinze Song,
-
Jian Li and
-
Hangen He
EURASIP
Journal on Image and Video Processing20132013:38
DOI: 10.1186/1687-5281-2013-38
© An et al.; licensee Springer. 2013
Received: 8 October 2012
Accepted: 7 June 2013
Published: 4 July 2013
Abstract
Abstract
This paper presents a camera-based lane departure warning system implemented on a field programmable gate array (FPGA) device. The system is used as a driver assistance system, which effectively prevents accidents given that it is endowed with the advantages
of FPGA technology, including high performance for digital image processing applications, compactness, and low cost. The main contributions of this work are threefold. (1) An improved vanishing point-based steerable filter is introduced and implemented on
an FPGA device. Using the vanishing point to guide the orientation at each pixel, this algorithm works well in complex environments. (2) An improved vanishing point-based parallel Hough transform is proposed. Unlike the traditional Hough transform, our improved
version moves the coordinate origin to the estimated vanishing point to reduce storage requirements and enhance detection capability. (3) A prototype based on the FPGA is developed. With improvements in the vanishing point-based steerable filter and vanishing
point-based parallel Hough transform, the prototype can be used in complex weather and lighting conditions. Experiments conducted on an evaluation platform and on actual roads illustrate the effective performance of the proposed system.
1 Introduction
Automobile accidents injure between 20 to 50 million people and kill at least 1.2 million individuals worldwide each year [
1].
Among these accidents, approximately 60% are due to driver inattentiveness and fatigue. Such accidents have prompted the development of many driver assistance systems (DASs), such as the onboard lane departure warning systems (LDWSs) and forward collision
warning systems. These systems can prevent drivers from making mistakes on the road and can reduce traffic accidents. An effective DAS should satisfy the following requirements: accuracy, reliability, robustness, low cost, compact design, low dissipation,
and applicability in real time, etc. Therefore, a personal computer, for example, is not suitable for the DAS platform because of its high cost and large size.
Nowadays, dozens of LDWSs are proposed and exist in the market place. These LDWSs are based on some different kinds of platforms. However, complex environments make LDWS applications difficult. Therefore, many of these systems are used only on highways, and
they typically suffer from defective operation under rainy or under heavy shadows.
To enhance the performance of current LDWSs under complex conditions, we implemented improvements in edge extraction and line detection. In the edge extraction step, we use the vanishing point to guide the orientation of edge pixels, thereby enhancing LDWS
performance under heavy shadows. We choose the Hough transform and develop its capability in the line detection step. Using the information of vanishing point, the space complexity of the Hough transform is greatly reduced. These two improvements enable our
system to work effectively under most lighting and weather conditions.
The remainder of this paper is organized as follows. Section 2 discusses some related works about edge extraction and line detection, especially the limitation of traditional Hough transform. Section 3 discusses the proposed hardware architecture of the LDWS
and the workflow of each of its parts. Section 4 describes the vanishing point-based steerable filter and its implementation on a field programmable gate array (FPGA) device. Section 5 presents the improved vanishing point-based parallel Hough transform, including
technical details and results. In Section 6, we theoretically and experimentally analyze the distribution of vanishing points. The influence of curves is also discussed in this section. Section 7 illustrates the details of the system and the results of on-road
experiments. Section 8 concludes the paper.
2 Related works
Lane detection is a key task of the LDWS. However, it is a difficult problem due to the complex environments. In addition, the single FPGA platform prevents many classical algorithms such as Canny or improved Canny algorithms from satisfying computing resources
and storage requirements. In this section, we mainly focus on improving the edge extraction and line detection algorithm to develop our LDWS to be more robust and effective.
2.1 Edge extraction algorithms
In order to detect lane robustly, one of the key aspects is edge extraction. Over 2 decades of research, many edge enhancement algorithms have been proposed [
2].
Canny algorithm and improved Canny algorithms are thought to be most effective under common environments [
3].
But their computing complexities limit their application on embedded platforms.
Recently, an algorithm named steerable filters is used in edge extraction [
1,
4–
6].
Its effect depends on the accuracy of the lane orientation. In [
4]
and [
1],
researchers analyzed the orientation of local features at each pixel and used this orientation as the direction. This approach is useful in most cases but results in poor performance when lane marking boundaries are not dominant under complex shadows. In [
5],
the detected angle of a lane in the pre-frame stage is chosen, but angle detection is characterized by errors when vehicles change lanes. For making the problem easier, Anvari [
6]
divided the image into several windows. In each window, a fixed direction was chosen for the steerable filter.
To improve the effectiveness of edge extraction, we developed and implemented an algorithm, which we call the vanishing point-based steerable filter, on an FPGA device. By estimating the vanishing point position in the next frame of an image, the orientation
at each pixel is computed under the guide of the vanishing point. Therefore, compared to previous algorithms, the result of our algorithm is much improved.
2.2 Line detection algorithms
Line detection is deemed the most important component of LDWSs. Numerous line detection algorithms and techniques have recently been proposed [
7–
12].
Among these algorithms, the Hough transform is one of the most robust and extensively used [
13–
17].The
Hough transform is implemented according to (1):
ρ=xcos(θ)+ysin(θ)
(1)
The main drawbacks of this algorithm are its considerable requirements for memory and computational time [
18].
Compared to personal computers, the embedded platform is much more sensitive to the usage of memory and computational resources. Therefore, the traditional Hough transform is almost impossible to apply in embedded platforms.
To solve these problems, researchers have made many improvements to the Hough transform. Chern et al. presented a parallel Hough transform to reduce execution time [
18].
However, its space complexity remains. A line segment detection system was also developed using the parallel Hough transform on FPGAs, but the same problem of resources needed prevents most type of FPGAs [
13].
For the same reason, Hough transform technologies were discarded by Marzotto [
19],
whose work is also researching an LDWS on a single chip.
To reduce the space complexity, Mc Donald [
20]
hypothesized an implicit constraint region of the vanishing point position during the Hough transform, but he did not provide details on how to design the constraint region and its size in relation to curved roads.
In this paper, we use the vanishing point as a guide to decrease the Hough transform’s space complexity. Unlike the traditional Hough transform, our improved version moves the coordinate origin of the Hough transform to the estimated vanishing point. Thus,
each lane marking crosses the Hough transform coordinate origin. In this ideal case, it only needs to store the parameter where
ρ=0. These lines that do not cross the vanishing point are disregarded. This is
the main reason our improved Hough transform can reduce the storage space and improve the detection performance.
3 Hardware architecture of LDWS
Dozens of LDWSs are proposed or exist in the market place today. Among these platforms, personal computers, microprocessors, and DSPs are based on single instruction single data (SISD) structures. On the other hand, the single instruction multiple data (SIMD)
structure is designed in [
19,
21,
22].
It is obvious that the SISD structure is flexible for symbol operations but has low capability for large data streams. By contrast, the SIMD structure is highly efficient for large data stream with simple operations, but low capability for complex operations.
In order to possess of both efficiency the large data stream operations and flexibility for symbol operations, Hsiao et al. presented an FPGA + ARM (Advanced RISC Machines) architecture of their LDWS [
23].
In the FPGA, an SIMD structure is designed for preprocessing. Complex operations are finished in the ARM, which is based on the SISD structure. We agree that an SIMD + SISD hardware architecture is effective to visual process. To reduce the size, cost, and
complexity of that hardware architecture, we implemented it on a single FPGA chip. A MicroBlaze soft core, which is embedded in the FPGA chip, is chosen instead of the ARM chip in our LDWS.
Our LDWS is composed of several units (Figure
1)
camera
control,
image receiver,
edge extraction,
line detection,
lane
tracking,
warning strategy, and
external communication control units.
Figure 1
The structure of LDWS. The architecture of the proposed LDWS.
3.1 SIMD + SISD architecture
Lane detection warning is a typical computer vision process. Analyzing the relationship between data streams and information included in this data stream, we divide the vision process into two levels: the data process level and the symbol process level. The
vision tasks in the data process level are characterized by a large data stream with simple operations, such as convolution, edge extraction, and line detection. By contrast, the vision tasks in the symbol process level are characterized by a small data stream
with complex operations.
Hence, two parts of different computational structures are specially designed to process these two kinds of vision tasks (Figure
1).
The computational structure for the data process is based on a SIMD structure that comprises specialized vision processing engines synthesized by the hardware description language (HDL). The other structure is based on a SISD structure that consists of an
embedded MicroBlaze soft core, which is offered by Xilinx for free.
The SIMD + SISD architecture has two advantages: first, these vision processing engines are specially designed and efficiently handle data process vision tasks. Second, MicroBlaze is considerably more flexible than processing engines, making these algorithms
easy to implement. It also improves complex algorithms and enables the convenient incorporation of new functions.
3.2 The flow of our system
The function, input and output sequences, and internal operations of the system are discussed as follows.
3.2.1 Camera controller unit
Our system uses a digital camera. In the camera controller unit, the automatic exposure control algorithm proposed by Pan et al. is implemented [
24].
Some parameters, such as exposure time and gain, are sent to the camera by serial peripheral interface bus. The others represent the camera’s enable signal and required frame signal, among others.
3.2.2 Image receiver unit
This unit receives image data from the digital camera under line synchronic and frame synchronic signals. Eight-bit gray data are transmitted to the FPGA based on a 40-MHz camera clock.
3.2.3 Edge extraction unit
This unit extracts an edge image from the original image using the vanishing point-based steerable filter. We use high-level information (the vanishing point) to obtain the orientation of the local features at each pixel. During edge extraction, each potential
edge pixel of the lane should be directed toward the vanishing point. The details of this algorithm and its implementation on the FPGA are described in Section 4.
The image receiver unit uses the 8-bit original image data, data enabling signal, and synchronic clock as input; the output are the 1-bit edge image data, data enabling signal, and synchronic clock.
3.2.4 Line detection unit
In this unit, a vanishing point-based parallel Hough transform is designed and implemented for line detection. When the edge image is extracted by the edge extraction unit, a BlockRAM registers the position of a series of edge points. The edge image is unsuitable
for calculation via a line equation because this equation requires
x and
y coordinates. The edge image, on the other hand, uses only binary information. We therefore
store a list of edge positions instead of the edge image. To reduce computational complexity, we implement a parallel Hough transform [
18]
in this unit. We move the coordinate origin of the Hough transform to the estimated vanishing point to reduce space complexity. During the Hough transform process, a series of double-port BlockRAM are used as parameter storage. Details on the line detection
algorithm and its implementation on the FPGA are described in Section 4.
This unit employs the 1-bit edge image data, data enabling signal, and synchronic clock as input; the output is a list of line position parameters.
3.2.5 Lane tracking unit
The lane tracking unit and the warning strategy unit are implemented in an embedded MicroBlaze soft core. A pair of local memory buses are used to exchange these parameters between MicroBlaze and other units. A series of rules are set to remove disturbance
lines, such as the vanishing point constraint and slope constraint. A simple algorithm similar to the Kalman filter is implemented for stable lane tracking.
This unit employs a series of line parameters as input; the output is a pair of final lane parameters.
3.2.6 Warning strategy unit
When double lanes are found, coordinate transform is carried out to determine the relationship between lanes and vehicle wheels. If a wheel crosses a lane, a warning message is sent.
3.2.7 Communication controller unit
For easy and thorough system debugging and operation, we designed a controller area network (CAN) bus and a universal serial bus (USB). The USB is used primarily to debug the algorithm; an example is that the processed data is transmitted to a computer for
debugging. The processed data include the original image data, edge image data, and all the line position parameters detected by our improved Hough transform. Therefore, testing our algorithms in the FPGA device is a convenient process. The CAN bus is used
mainly for receiving vehicle information (because CAN bus is widely used in vehicles), such as vehicle velocity and indicator information. The CAN bus is also used to send out warning signals from the LDWS, including those lane position parameters, distance
between vehicles and lanes, and time spent crossing a lane. In addition, the CAN bus is used to enter the user’s command instructions.
4 Edge extraction using the vanishing point-based steerable filter
In this section, we use the estimated vanishing point to develop the effectiveness of the steerable filter. The details on the implementation of the proposed algorithm on the FPGA device are also presented.
4.1 Vanishing point-based steerable filter
The core principle of the steerable filter is that a Gaussian filter in any orientation can be synthesized by a set of basic Gaussian filters [
25].
This principle can be expressed by:
Rθ=cos(θ)R0∘+sin(θ)R90∘
(2)
where
R0∘=I∗G0∘,
R90∘=I∗G90∘,
and
I means the original image;
G0∘ and
G90∘ are
a pair of basic filters, and
∗represents the convolution operation. Therefore, the filter result of the
θ orientation can be synthesized using the results of each basic filter.
The effect of the steerable filter on edge extraction depends on the accuracy of the lane orientation. Common edge detectors identify the local maxima of intensity changes as the orientation [
1,
4].
Occasionally, however, boundary lane markings may not be as dominant as other road features under shadows. The local features of lane markings follow a clear global distribution pattern in road scene images. We prefer identifying the local edges at each pixel
location according to the high-level information (vanishing point) on the lane markings. A local edge extraction algorithm, called the vanishing point-based steerable filter, is proposed. The implementation of the algorithm is summarized as follows.
Input: digital image of the road scene, the estimated vanishing point.
Output: binary image containing edge points
bw.
Step1: The desired direction at each pixel is calculated according to the estimated vanishing point. A digital image called the direction map (Figure
2b)
is then obtained at the same size as that of the input image. The range of direction is [-pi, pi].
Figure 2
The process of the vanishing point-based steerable filter. The process of the vanishing point-based steerable filter.
(a) is the original
image, and
(b) is the direction map decided by the estimated vanishing point.
(c) and
(d) are
the response image convoluted by
G0∘ and
G90∘.
(e) is
the result of rising (red) and falling (green) edges synthesized by
(c) and
(d).
(f) is
the final binary image of matching the rising and falling edges.
(g) and
(i) are the result of Sobel algorithm and Canny algorithm.
(h)and
(j) are
the result of matching both rising edges and falling edges of
(g) and
(i).
Step2: A pair of basic filters,
G0∘ and
G90∘ are
used to convolve the input image and obtain response images, respectively. The results are shown in Figure
2c,d.
Step3: The result of all pixels are obtained according to the direction map, as shown in Figure
2e.
This result is a linear combination of the results for basic filters.
Step4: The rising and falling edges are mapped, and the final binary image
bw (Figure
2f)
is obtained. We then return to
bw.
Figure
2 shows
the process involved in our edge extraction algorithm. Estimating the vanishing point yields the orientation at each pixel (Figure
2b).
At the same time, a pair of basic filters is convolved with the original image. The results are shown in Figure
2c,d.
Using the orientation map as reference, we synthesize (c) and (d) into (e). In Figure
2e,
the red points denote the rising edges, and the green points represent the falling edges. Figure
2f
shows the final result of matching the rising and falling edges.
4.2 Implementation on an FPGA device
The steerable filter is advantageous in that basic filters can work independently on an FPGA device. The proposed framework in our system is designed in a pipeline and in parallel. It is combined by two parts: a
couple of basic filters and the coefficients for synthesizing results into a final outcome. The steerable filter can generally be arranged in any order, depending on the number of basic filters. The basic set of filters is easy to express in discrete form
from a 2D Gaussian function: an
n ×
m matrix. All digital data are pipelined on the structure under the control clock (Figure
3a).
At each clock,
n ×
m adjacent pixels are chosen to complete a couple of convolution operations. Therefore, convolution is completed during the arrival of the
original data, and no extra computational time is spent.
Figure 3
The architecture of the vanishing point-based steerable filter implemented on FPGA. The architecture of the proposed filter implemented on FPGA.
(a) is
the structure of convolution operation.
(b) is the structure of synthesizing the results from basic filters into the final result according to orientations at each pixel. DP means data position,
and VP means vanishing point position. CODIC IP core is used to compute the orientation at each pixel.
The same number of engines is used to complete the convolutions of all the basic filters. With different coefficients in the convolution operation, the results of these basic filters are simultaneously generated as shown in Figure
3b.
Figure
3 shows
the core function of the proposed algorithm. Its time and resource cost is listed in Table
1.
CC in Table
1means
camera control model, and EE means edge extraction model. We can see that by adding the proposed filter, almost no external time is needed, and its resource cost is also very low.
Table 1
Time and resources occupation of the proposed LDWS
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
|