Go Back   Team-BHP > Under the Hood > Technical Stuff

Thread Tools Search this Thread
Old 25th February 2014, 15:29   #16
freewheelburnin's Avatar
Join Date: Oct 2007
Location: bangalore
Posts: 272
Thanked: 26 Times
Default Re: Advice on designing a 'Sleep Detection System'

Here are my suggestions:

Heuristic algorithm:Try to find out other ways to detect if the subject is sleepy to make it less prone to failure and use a combination of methods. eg: Movement of head,feedback from driver controls such as steering,gas pedal etc.

Hardware: Try using an Infrared camera and operate on detection using that.Remember that IR light is non intrusive to the driver and would come with lot of advantages

Matlab: Use Matlab to come up with an algorithm. For example take images of the subject for say 2 minutes.The Matlab would never be able to work in realtime for obvious reasons.But maybe say after 5 minutes or so you can detect that at the 60th second the subject felt sleepy.This is enough from an algorithm point of view

Designing hardware:
Approach 1: A pure hardware approach (FPGA tools such as ALTERA have a matlab link ) which enables you to convert your MATLAB code into real hardware with relative ease.
Approach 2:A Hardware software partitioning where you can probably seperate the DSP filters from the processing to be done and model the filters in Matlab.Then use the FPGA tool with the MATLAB link to model that part into FPGA hardware.You will need some open bus architecture and a small processor core(available easily as a soft IP for FPGA) and figure out how the processor can control these dedicated DSP blocks sequentially.Write a simple piece of code which controls the data flow.
Approach3: Pure Software : Use some dedicated DSP processor board with a tool kit that allows matlab to Software conversions.

These are definitely not optimized solutions but am sure you can get things working.

Last edited by freewheelburnin : 25th February 2014 at 15:39. Reason: To add missed out detail
freewheelburnin is offline   (1) Thanks Reply With Quote
Old 26th February 2014, 10:14   #17
Join Date: Feb 2005
Location: Mumbai
Posts: 24
Thanked: 19 Times
Default Re: Advice on designing a 'Sleep Detection System'

There should be a small shock sensor included inside the seat. If it detects the driver dozing off even after persistent alarms, it needs to give out a nice low voltage shock to jerk the driver out of his slumber.
TheDevil is offline   (1) Thanks Reply With Quote
Old 26th February 2014, 13:22   #18
Join Date: Jan 2014
Location: Bangalore
Posts: 12
Thanked: 4 Times
Default Re: Advice on designing a 'Sleep Detection System'

Very good project Nigel. I'm sure your project will save may lives, if successful. I lost a friend a couple of years back when he fell asleep behind the wheel and rammed into a parked lorry. He died on the spot and his mom was gravely injured.

I hope your project will prevent such incidents. All the best pal!
Serpentor11 is offline   (1) Thanks Reply With Quote
Old 27th February 2014, 19:37   #19
Join Date: Jul 2012
Location: Bangalore
Posts: 20
Thanked: 8 Times
Default Re: Advice on designing a 'Sleep Detection System'

Hi nigel,
It's a good project but could be more complicated (read enjoyable ) than what you think it is. Having worked quite extensively with image processing algorithms and their implementation on DSPs, here's is what I feel:

1. I agree with NetfreakBombay that feature extraction is the way to go. The paper provided seems to have a good, workable approach and could be implemented without much difficulty.

2. The approach suggested by your guide seems flawed to me. For such precision in color-based segregation of the image you need excellent brightness, a good camera and most ideal conditions of image capture which is far from the actual driving scenario. Believe me, I had faced this difficulty myself working with a >INR500000 3000fps CMOS Camera. Finally we had to place the camera assembly fixed at a specific place and keep it undisturbed throughout our work. You could imagine what could be the case with a webcam. Also, hues matter the most and define your threshold to generate binary images. Not eyes of all people have crystal clear dark eyeballs on bright white conjuctiva. If things go wrong, you could end up detecting a thick mustache as a pair of eyes.

3. Algorithm/System: I would suggest going for a more holistic approach, which could include not just blink measurement, but also various other data such as head movements, control (A,B,C) inputs, steering inputs etc. and design a complete control system in MATLAB/SIMULINK and train the system extensively for various real life scenarios. You could go for an ANN (Artificial Neural Netwroks) based approach if you like to make the system more robust and learnable (read Intelligent). This being a system already developed and implemented, I am sure you would be able to get ample of resources on the internet.

4. Hardware: I would strongly suggest to use an IR Camera instead of a webcam (current system horribly fails during the night). This way, you could also eliminate some problems of image extraction like poor lighting, colour segmentation etc. Depending on your system, you could go in for a DSP/FPGA or a simple microcontroller. If the system turns out to be extremely image processing intensive and you need and you need floating point accuracy, it is imperative to go for a DSP. An OMAP 4/5 or TI 6455 DSP should be more than sufficient for your application.

5. Implementation: This is where the major challenge lies. Its extremely difficult to code basic DSP algorithms in C, forget about IP ones. But MATLAB's Embedded Coder comes to your rescue. Its amazing how guys at MathWorks have made life so beautiful and simple. With this toolbox you can have your whole MATLAB code or Simulink model written in C and automatically embedded in the target processor you specify. (Research on Embedded Coder and Hardware-in-the-loop simulation on mathworks website).

Since you have a crunch of time, it is advisable to split the work among your team members. At this stage, do a lot of literature survey and have a clear idea in your mind (most essential). Design, redesign and make your system and algorithms flawless. Once this happens, the rest becomes trivial. All the Best!
srikanth.hv is offline   (1) Thanks Reply With Quote
Old 1st March 2014, 13:46   #20
Join Date: Feb 2014
Location: Bangalore/Goa
Posts: 20
Thanked: 33 Times
Default Re: Advice on designing a 'Sleep Detection System'

Thanks a lot guys for all the advice. Have not succeeded using my guide's approach of detecting the eyes, his method detects other regions of the face besides the eyes. Will ask him today for a different approach and if time permits( he seems very busy) to teach me feature extraction as many of you have said it's the best approach for the detection of eyes.
nigel92 is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Designing a Home Theatre System Samurai Gadgets, Computers & Software 47 26th February 2014 12:56
world’s first pedestrian detection system bmw530i Technical Stuff 0 23rd February 2010 13:08
Anti Sleep Accessory genesis Modifications & Accessories 18 31st May 2009 16:42
Miles To Go Before I Sleep....... rakesh_raja Travelogues 1 11th October 2008 01:21
Natural music for sleep??? furioussphinx Shifting gears 7 11th May 2006 03:18

All times are GMT +5.5. The time now is 16:07.

Copyright ©2000 - 2018, Team-BHP.com
Proudly powered by E2E Networks