Skip to content

v1.0.0

Choose a tag to compare

@sabrysm sabrysm released this 15 Feb 21:49
· 5 commits to master since this release

Driver Monitoring System

A real-time driver monitoring system implementing Euro NCAP requirements for driver state detection using computer vision and machine learning.

Key Components

1. PoseEstimation.py

  • Main processing pipeline for facial analysis
  • Uses MediaPipe Face Mesh for facial landmark detection
  • Implements:
    • Eye Aspect Ratio (EAR) tracking
    • Mouth Aspect Ratio (MAR) for yawning detection
    • Head pose estimation (pitch, yaw, roll)
    • PERCLOS (percentage eye closure) calculation
    • Real-time visualization

2. DecisionLayer.py

  • Implements Euro NCAP compliant driver state assessment
  • Features:
    • Multiple driver states (Alert, Drowsy, Microsleep, etc.)
    • Visual Attention Time Sharing (VATS) monitoring
    • Gaze strategy detection (Owl vs Lizard patterns)
    • Risk level assessment
    • Progressive response system

3. Config.py

  • Centralized configuration management
  • Contains:
    • MediaPipe parameters
    • Facial landmarks indices
    • Detection thresholds
    • Visualization settings
    • Camera parameters

Key Features

  1. Driver State Detection

    • Alert/Drowsy state monitoring
    • Microsleep detection
    • Distraction monitoring
    • Phone use detection
  2. Head Pose Analysis

    • 3D head pose estimation
    • Gaze direction tracking
    • Looking away detection
  3. Drowsiness Metrics

    • PERCLOS calculation
    • Blink rate monitoring
    • Yawn detection
    • Combined drowsiness assessment
  4. Visualization

    • Real-time facial landmark overlay
    • Head pose direction indicator
    • Status dashboard
    • Color-coded warnings

Technical Details

  • Framework: OpenCV, MediaPipe
  • Language: Python 3.x
  • Key Dependencies:
    • opencv-python
    • mediapipe
    • numpy
  • Performance: Real-time processing (30+ FPS on modern hardware)

Implementation Notes

  • Uses rolling windows for temporal analysis
  • Implements hysteresis for state transitions
  • Euro NCAP compliant warning systems
  • Modular architecture for easy extension