Heart Rate EVM (Eulerian Video Magnification) is a real-time heart rate monitor that uses Eulerian Video Magnification techniques to amplify subtle color changes in facial skin. These changes correlate with blood flow, enabling heart rate detection using a standard webcam.
- Real-time BPM Calculation: Detect and display beats per minute (BPM) directly on the screen.
- Color Magnification: Amplifies subtle color variations to highlight blood flow patterns.
- Face Detection: Focuses on the detected face region for accurate results.
- Live Visualization: Displays processed video with overlaid BPM and FPS.
- Customization: If the FPS in your machine is too high, causing noticeable shifts in BPM calculations, you can modify the code to calculate an average BPM over a 1-second interval or adjust other parameters for improved stability.
- Captures live video from a webcam.
- Detects a face and isolates the region of interest.
- Processes the video using Gaussian pyramids and Fourier transforms.
- Filters frequencies within the desired range for heart rate detection.
- Calculates BPM and updates the display.
- Python 3.9
- OpenCV
- NumPy
- cvzone
- Additional dependencies in
requirements.txt
-
Clone the repository:
git clone https://github.com/your-repo/heart-rate-evm.git cd heart-rate-evm -
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python main.py
-
Use a webcam and ensure proper lighting for optimal results. Press Q to exit.
This project is based on the Eulerian Video Magnification (EVM) technique developed by MIT. https://people.csail.mit.edu/mrub/evm/
Disclaimer: This application is not a medical device and should not be used for clinical purposes.