Transcript Slide 1

Final Year Project Report
2006-2007
Martin Gallagher
4th Year Electronic Engineer
Development of a
Driver Alert System
for Road Safety
Today's Report
•
•
•
•
•
Initial Specification
Background
Development of Project
- Software and Hardware
Development Issues
Results
Initial Specification
1. Purpose of project to investigate the
development of a system for detecting
the likelihood that the driver is about to
fall asleep
1.1 Sound alarm should this occur
Initial Specification
2. System primarily based on a small
camera based on the dashboard
2.1 It will be used to “track” drivers eyes
2.2 Attempt to determine if driver falls asleep
Initial Specification
3. Enhance reliability of the system by
making use additional sensor devices.
4. Initial algorithm development will be
carried out in MATLAB, with the intention
of porting some of the functionality to a
suitable embedded system.
Initial Proposal
Using MATLAB as a development tool
develop the basic functionality of the
system with the Hough Transform as the
basis for the detection of the eyes.
Description of Hough Transform
It is a method used to detect shapes in a
digital image. There are a number of
versions used to detect different shapes
but all follow the same core principals
The circular version was used in this
situation to detect the iris in the eye
Description of Hough Transform
Description of Hough Transform
The Circular Hough Transform
uses the intersection of right
cones to accumulate votes at a
point.
This accumulation of votes
corresponds to a centre point.
From this circular objects can
be extracted from images.
Software
Using a transform
available on the
Mathworks website
I have been able to
detect circular
areas of interest in
pictures and test
video
Raw Image with Circles Detected (center positions and radii marked)
50
100
150
200
250
300
350
400
450
100
200
300
400
500
600
3-D View of the Accumulation Array
400
300
200
100
0
0
250
50
200
150
100
100
150
50
0
Problems with software
• This picture shows
both eyes being
detected and are
highlighted in blue.
• Lighting plays a
major role as
shadow can
causes error in the
detection process
Eye Detection Algorithm
Once the Hough transform has been
applied there are usually a surplus of
circles detected.
Filtering out these surplus due to geometric
characteristics of eyes yields an
increased stability in performance
Pick Eyes Example
Step 1.
Capture Frame
Pick Eyes Example
Step 2.
Crop Frame
Pick Eyes Example
Step 2.
Crop Frame
Pick Eyes Example
Step 3.
Convert Frame to Grayscale
Pick Eyes Example
Step 4.
Adjust Frame to improve
image for processing
Pick Eyes Example
Step 5.
Apply Hough
Transform to frame
Pick Eyes Example
Step 5.
Apply Hough
Transform to frame
Circles are detected and shown in this
image
Pick Eyes Example
Step 6.
Apply pickEyes
function to frame
Pick Eyes Example
Step 6.1 These
Remove
are pixels
points
close
with
to the
white end of thehigh
spectrum
index values.
(255)
As this is image is quite dark, with the
highest index value of 75. No points are
removed at this stage.
Pick Eyes Example
Step 6.2
Match points of similar
radius
Pick Eyes Example
Step 6.3 Apply Distance Condition
Remove sets that lie outside
Maximum width and inside Minimum
Pick Eyes Example
Step 6.4
Apply angle test to
points
Remove points that lie at a greater
angle to the X axis than specified.
Pick Eyes Example
Step 6.5 Remaining points should be:
1.Similar in Radius
2.Within specified distance limits
3.Within specified angle limits
Pick Eyes Example
Step 6.6 Original Image highlighted
Current
Image
frame
Lower
Threshold
Eyes
Upper
Threshold
Next
Image
frame
Hardware
• Camera
• Pressure Sensors
1. FSR’s
2. ADuC 8031 Development Board
Camera
The camera used is a
standard CMOS
desktop web cam.
The resolution of
640x480 pixels was
chosen so as to get
adequate images and
allow for speedy
computation.
Pressure Sensors
Diagram from FSRguide
These will be used to
monitor the drivers grip
on the steering wheel.
The Force Sensitive
Resistors consist of 2
flexible substrates, with
printed electrodes and
semiconductor material
sandwiching in a spacer
substrate.
Pressure Sensors
The conductance is
plotted vs. force (the
inverse of resistance
1/r).This format allows
interpretation on a linear
scale. For reference, the
corresponding
resistance values are
also included on the
right vertical axis.
Diagram from FSRguide
Pressure Sensor Circuit
The FSR’s are arranged in
a voltage divider circuit.
This involved placing the
FSR’s in series with a
known resistance and
measuring the voltage
across it while the FSR’s
vary with pressure.
9V
FSR1
FSR2
100Ω
V
ADuC 8031
• The Analog Devices product, the
ADuC831 was chosen for this project as it
provided the embedded system
functionality described in the initial
specification. Its core consists of an 8052
Microcontroller which provides the
necessary processing power to compute
the demands made on it by the
requirements of this project.
ADuC 8031
• The ADuC 8031 is used to sample the
data coming from the pressure sensors.
The data is sampled and transferred to the
PC via the serial port.
• The signal is converted to 12bits . This is
too sensitive so the data is adapted to give
25 levels, approximately 0-2.5v. The ASCII
value of the levels is sent to MATLAB to
determine Driver grip of the steering wheel
Results
• Using the MATLAB environment to
integrate the components of this project I
have been able to develop a system that
monitors both visual clues from the Driver
and auxiliary data from pressure sensors.
• The program processes a frame of image
data and numerous pressure sensor
readings per loop.
Results
• This allows system to grade the data and
trigger a response if the data values fall
below defined threshold levels.