Advanced Remote Photoplethysmography Application with real-time heart rate and HRV estimation
Project description
Advanced rPPG (Remote Photoplethysmography) Application
A cross-platform Python application for remote heart rate monitoring using computer vision techniques. This advanced application provides real-time heart rate estimation, HRV analysis, and comprehensive signal quality assessment.
๐ Features
- Live Video Processing: Real-time heart rate monitoring from webcam
- File-based Processing: Analyze pre-recorded video files
- Advanced Face Detection: Using MediaPipe for robust face tracking
- Multiple rPPG Algorithms: Chrominance, POS, and Green Channel methods
- Signal Quality Metrics: Comprehensive quality assessment and recommendations
- Real-time Visualization: Live plots of heart rate, HRV, and signal quality
- HRV Analysis: Time-domain, frequency-domain, and non-linear metrics
- Cross-platform GUI: Built with PyQt5 for Windows, Linux, and macOS
- Data Export: Save results to CSV/JSON formats with detailed reports
๐ Requirements
- Python: 3.8 or higher
- Operating System: Windows, Linux, or macOS
- Hardware: Webcam (for live processing)
- Memory: Minimum 4GB RAM (8GB recommended)
- Storage: 1GB free space
๐ Quick Installation
Option 1: Automated Installation (Recommended)
# Clone the repository
git clone https://github.com/Sherin-SEF-AI/advanced-rPPG.git
cd advanced-rPPG
# Run the installation script
./install.sh
Option 2: Manual Installation
# Clone the repository
git clone https://github.com/Sherin-SEF-AI/advanced-rPPG.git
cd advanced-rPPG
# Create virtual environment
python3 -m venv rppg_env
# Activate virtual environment
# On Linux/macOS:
source rppg_env/bin/activate
# On Windows:
rppg_env\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install the application
pip install -e .
Option 3: Using pip (if published)
pip install advanced-rppg
๐ฏ Usage
Starting the Application
# Activate virtual environment (if using manual installation)
source rppg_env/bin/activate
# Run the application
python main.py
# Or use the command-line tool
rppg-app
Using the Application
-
Live Monitoring:
- Click "Start Live" to begin real-time heart rate monitoring
- Position your face in the camera view
- Ensure good lighting conditions
- Stay relatively still for best results
-
Video File Analysis:
- Click "Load Video" to select a video file
- The application will process the video and display results
-
Viewing Results:
- Real-time heart rate is displayed in the control panel
- Signal quality metrics are shown with color-coded indicators
- HRV metrics are calculated and displayed
- Live plots show signal trends over time
-
Saving Data:
- Use File โ Save Data to export results
- Choose between CSV and JSON formats
- Comprehensive reports are generated automatically
๐ Understanding the Results
Heart Rate Display
- Green: Normal range (60-100 BPM)
- Orange: Slightly elevated/depressed (50-60 or 100-120 BPM)
- Red: Outside normal range (<50 or >120 BPM)
Signal Quality Metrics
- Overall Quality: Combined score of all quality factors
- SNR: Signal-to-Noise Ratio
- Stability: Signal consistency over time
- Lighting Consistency: Uniformity of illumination
- Face Quality: Face detection confidence
HRV Metrics
- RMSSD: Root Mean Square of Successive Differences
- SDNN: Standard Deviation of NN Intervals
- pNN50: Percentage of successive RR intervals >50ms
- LF/HF Ratio: Low Frequency to High Frequency ratio
โ๏ธ Configuration
Algorithm Selection
Choose from three rPPG algorithms:
- Chrominance: Advanced color-based method (default)
- POS: Plane-Orthogonal-to-Skin method
- Green Channel: Simple green channel analysis
Processing Parameters
- FPS: Frame rate for processing (15-60 fps)
- Face Landmarks: Toggle face landmark visualization
- Quality Metrics: Enable/disable quality assessment
๐ง Troubleshooting
Common Issues
-
No Face Detected:
- Ensure face is clearly visible in camera
- Check lighting conditions
- Try adjusting camera position
-
Poor Signal Quality:
- Improve lighting (avoid shadows and glare)
- Reduce movement during measurement
- Ensure consistent camera distance
-
Application Won't Start:
- Check Python version (3.8+ required)
- Verify all dependencies are installed
- Check system requirements
-
Camera Not Working:
- Ensure camera permissions are granted
- Check if camera is being used by another application
- Try different camera index in settings
Performance Optimization
- Lower FPS: Reduce processing load for better performance
- Smaller Window: Process smaller video regions
- Quality vs Speed: Balance between accuracy and real-time performance
๐ Project Structure
advanced-rPPG/
โโโ main.py # Main application entry point
โโโ requirements.txt # Python dependencies
โโโ setup.py # Installation script
โโโ install.sh # Automated installation
โโโ README.md # This file
โโโ rppg_core/ # Core rPPG processing
โ โโโ __init__.py
โ โโโ face_detector.py # Face detection and tracking
โ โโโ signal_processor.py # rPPG signal processing
โ โโโ quality_metrics.py # Signal quality assessment
โ โโโ hrv_analyzer.py # HRV analysis
โโโ gui/ # User interface
โ โโโ __init__.py
โ โโโ main_window.py # Main application window
โ โโโ video_widget.py # Video display and processing
โ โโโ plot_widget.py # Real-time plotting
โ โโโ control_panel.py # Control panel
โโโ utils/ # Utility functions
โ โโโ __init__.py
โ โโโ file_utils.py # File operations
โโโ data/ # Data storage directory
โโโ .gitkeep
๐งช Technical Details
rPPG Algorithms
-
Chrominance Method:
- Uses color space transformations
- Combines RGB channels for optimal signal extraction
- Most robust for varying lighting conditions
-
POS Method:
- Projects signals onto plane orthogonal to skin tone
- Reduces motion artifacts
- Good for stationary subjects
-
Green Channel Method:
- Simple green channel analysis
- Baseline method for comparison
- Fastest processing
Signal Processing Pipeline
- Face Detection: MediaPipe-based face detection and landmark extraction
- ROI Selection: Forehead region extraction for signal processing
- Signal Extraction: RGB signal extraction from ROI
- Filtering: Bandpass filtering (0.7-4.0 Hz)
- Frequency Analysis: FFT-based heart rate estimation
- Quality Assessment: Multi-factor quality evaluation
๐ค Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
# Clone repository
git clone https://github.com/Sherin-SEF-AI/advanced-rPPG.git
cd advanced-rPPG
# Install development dependencies
pip install -e .[dev]
# Run tests
pytest
# Format code
black .
# Type checking
mypy .
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- MediaPipe: Face detection and landmark extraction
- OpenCV: Computer vision processing
- PyQt5: Cross-platform GUI framework
- SciPy: Signal processing algorithms
- NumPy: Numerical computing
๐ Support
- Issues: GitHub Issues
- Documentation: Wiki
- Email: sherin.joseph2217@gmail.com
๐ฌ Research Applications
This application is suitable for:
- Clinical Research: Heart rate monitoring studies
- Sports Science: Exercise physiology research
- Human-Computer Interaction: Stress detection
- Telemedicine: Remote health monitoring
- Wearable Technology: Validation studies
Note: This application is for research and educational purposes. It is not intended for medical diagnosis or treatment. Always consult healthcare professionals for medical concerns.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file advanced_rppg-1.0.1.tar.gz.
File metadata
- Download URL: advanced_rppg-1.0.1.tar.gz
- Upload date:
- Size: 51.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66b704f814abbd0d18f3010a3f745b5500e9e15a2c70e0e2301d0b2e5f53bae2
|
|
| MD5 |
8688ad8ab63894c32b05032e28049a36
|
|
| BLAKE2b-256 |
953a7819eacf3c0727eda71d17736c07f688da2a3cba1a1e53d05992c071b46d
|
File details
Details for the file advanced_rppg-1.0.1-py3-none-any.whl.
File metadata
- Download URL: advanced_rppg-1.0.1-py3-none-any.whl
- Upload date:
- Size: 32.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fe309cc2ff496e6faf7aad42c80f6b99bbb4f19998b209ac84a0938ac5d40f6
|
|
| MD5 |
2d8b07a791f228105e83cca91183d3bd
|
|
| BLAKE2b-256 |
349f261cc00bc0e585315eb916397498dce62f10982cd03e9b984a7d4ef441e1
|