Drowsiness Detection

14
Comparison of compression tools in H.264 and VC-1 Drowsiness Detection

description

Drowsiness Detection

Transcript of Drowsiness Detection

Comparison of compression tools in H.264 and VC-1

Drowsiness Detection

Introduction

Detecting Drowsiness of the Driver by finding his state of “eye” - Open or Closed.

Steps Involved in our method:

Step1: Continuously Monitoring Driver’s Eye to check if it “open” or “Close”

Steo2: If Eyes are Closed Continuously for some xxx seconds, Rise an Alarm.

Introduction cont.,

Introduction cont.,

We did step1(Eye State Detection) in two methods

Method 1: Using Opencv’s Haar Detect Objects.

Method 2: Using Morphology and other Image Processing Techniques.

Method 1: Eye State Detection using OpencV

Face Detection

Face Detected

?

Set ROI to a portion of face region• Discard Few Pixels from top(Skip Forehead)• Process only 1/3 rd of face Height

Input frame

Eye Detected

?

Yes

No

Detect for Eye in ROI

Eye State = OPEN Eye State = CLOSE

Approach Followed:

No

Skip the

frame

How OpenCV Eye Detection Works

Eye Detection using OpencV Haar Detect Objects

Training and Generating a Classifier using Haar Features, a set of features distinctive features are

extracted that can be used to classify the object(Eye) are selected

Using the Generated Classifier (with a set of features that give that chance to find the desired object) for

Object(Eye) Detection in test input/image

Training a Haar Classifier

Initially proposed by Paul Viola and improved by Rainer Lienhart.

A few thousands of sample views of a particular object (Eye), called positive examples, that are scaled to the same size (say, 15x10) are to be collected.

Negative examples - arbitrary images(that are not an eye: Nose, lips, Ear, Car, chair etc.,) of the same size are also required.

With those Positive and Negative Samples given, a Classifier is trained, CASCADED and BOOSTED.

Detection Using the Trained Classifier

E1

Search Window

E2

En

Eye

Not an Eye

The process of Eye detection slides a “search window” through the image, checking whether an image region can be considered as a “Eye object” or not. The detector assumes a fixed scale for the object, but since Eye in an image can be different from the assumed scale, the “search window” goes trough the image several times, searching for the object across a ranges of sizes.

Code point View of Trained Haar Classifier

Opencv expects a trained classifier in the “xml” format containing all the information : Minimum window size, no of stages, weights, thresholds etc.,

Code: Haar Detect ObjectscvSetImageROI(img, /* the source image i.e., Image with Face Detected */

cvRect( r->x, /* x = start from leftmost */

r->y + (r->height/5.5), /* y = a few pixels from the top */

r->width, /* width = same width with the face */

r->height/3.0 /* height = 1/3 of face height */

) );

eyes = cvHaarDetectObjects( img, /* the source image, with the estimated location defined */

cascade_eye, /* the eye classifier */

storage, /* memory buffer */

1.2, 4, 0, /* scale factor, neighborhood, do_canny_purring*/

cvSize(15, 15) /* minimum detection scale */

);

Using OpenCV’s function for Embedded

Extracting the Required functions

Tuning according to the requirement of Embedded

Floating Point to Fixed Point Conversion

Generating Classifier for as per Our Requirement

Turning Haar Trained Classifiers which are in the form of

xml files into constant arrays.

Porting and Integration

We ported, Optimized and Validated the same to IPNC’s floating point DSP C674x+, doing all the required steps.

@ 500 MHz , processing time for eye detection.Before Optimization : 110 – 130mSAfter Optimization : 50 – 60 mS

Advantages

Detects the Eye very Efficiently

Works good in high and medium light conditions

Less False Detection

Disadvantages

Less or No Detection in very poor Light / Night (Can be overcome by using high Range powerful IR LEDS along with Cam).

If a person wears very powerful Anti-glare spectacles and some kind of very complex framed spectacles eye detection rate will be less, rising false alarms (Can be overcome by Training a classifier with a positives having wide range of spectacles ).

Allows tilting of face upto some angle only. (If face is tilted greater than around 45degrees, it can’t able to detect eyes – problem with our FD only, hw engine is not having this issue).