CarSafe app is a smartphone app that gives two key safety features that are only found in luxury and expensive vehicles. One of them is a lane-departure warning and driver fatigue alerts.
http://www.youtube.com/v/tAd_sSfhZTw
The similar capabilities that are found in cars like Toyota's high-end lexus range, lane departure systems have been packed into this Android app.With a Google Galaxy Nexus phone mounted on the windscreen, the front camera points at the driver, tracking head pose, gaze direction and blink rate. If the driver seems drowsy, a coffee cup appears on the screen and the phone beeps.
The back-facing camera is trained on the road and the app checks you are at a safe distance from the car in front and also checks you are not weaving outside the white lines of the traffic lane.
Though several tests have yielded quite good results, the technological challenge still remains atleast for few years. This is because existing cellphones can't access both cameras at once. So the team has written code that continually switches between the two cameras – but that means they can only analyse scenes at a rate of eight frames per second, reducing the app's ability to assess safety when the car is travelling at speed. This challenge is likely to be taken care of by the launch of the new generation of smartphones where phones will allow software to access both cameras simultaneously.
ref:newscientist