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.
Metadata
Release files for advanced-rppg 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| advanced_rppg-1.0.1.tar.gz | 51.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| advanced_rppg-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.5 kB
Release files / advanced_rppg-1.0.1.tar.gz
| Download URL | advanced_rppg-1.0.1.tar.gz |
|---|---|
| Size | 51.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66b704f814abbd0d18f3010a3f745b5500e9e15a2c70e0e2301d0b2e5f53bae2
|
|
BLAKE2b-256 checksum How to use checksums |
953a7819eacf3c0727eda71d17736c07f688da2a3cba1a1e53d05992c071b46d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / advanced_rppg-1.0.1-py3-none-any.whl
| Download URL | advanced_rppg-1.0.1-py3-none-any.whl |
|---|---|
| Size | 32.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3fe309cc2ff496e6faf7aad42c80f6b99bbb4f19998b209ac84a0938ac5d40f6
|
|
BLAKE2b-256 checksum How to use checksums |
349f261cc00bc0e585315eb916397498dce62f10982cd03e9b984a7d4ef441e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|