Heartbeat
Desktop implementation of Remote Photoplethysmography – Measuring heart rate using facial video.
Install / Use
/learn @prouast/HeartbeatREADME
Heartbeat: Measuring heart rate using remote photoplethysmography (rPPG)
Looking for more powerful and up-to-date rPPG tools?
Check out our latest libraries and apps!
| 📌 Tool | 🚀 Features | ⚡ Methods | 🔗 Get Started | |---------|-------------|-------------|----------------| | Python Library | File analysis (HR, RR, HRV) | G, POS, CHROM, VitalLens API | GitHub | | JavaScript Library | Webcam or file analysis (HR, RR, HRV) | G, POS, CHROM, VitalLens API | GitHub | | iOS SDK | Webcam or file analysis (HR, RR, HRV) | VitalLens API | GitHub | | iOS App | Webcam processing (HR, RR) | VitalLens | App Store | | Rouast Labs | More about our research & tech | VitalLens | Website |
This is a simple implementation of rPPG, a way to measure heart rate without skin contact. It uses a video recording or live feed of the face to analyse subtle changes in skin color.
Here's how it works:
- The face is detected and continuously tracked
- Signal series is obtained by determining the facial color in every frame
- Heart rate is estimated using frequency analysis and filtering of the series
If you are interested in the specifics, feel free to have a read of my publications on the topic:
- Remote Photoplethysmography: Evaluation of Contactless Heart Rate Measurement in an Information Systems Setting
- Using Contactless Heart Rate Measurements for Real-Time Assessment of Affective States
- Remote heart rate measurement using low-cost RGB face video: A technical literature review
See also my minimal JavaScript implementation and Browser Demo.
Demo
Dependencies
The following libraries are required to run Heartbeat:
They must be installed on the system such that headers and libraries are found on the compiler's standard search path.
Installation
For building a Makefile is available that works on macOS:
$ make
Alternative compilation for Ubuntu. Works with opencv 3.1:
$ g++ -std=c++11 Heartbeat.cpp opencv.cpp RPPG.cpp `pkg-config --cflags --libs opencv` -o Heartbeat
Settings
After building, the app can be run via
$ ./Heartbeat
Several command line arguments are available:
| Argument | Options | Description | | --- | --- | --- | | -i | Filepath to input video | Omit flag to use webcam | | -rppg | g, pca (default: g) | Specify rPPG algorithm variant - only green channel or rgb channels with pca | | -facedet | haar, deep (default: haar) | Specify face detection classifier - Haar cascade or deep neural network | | -r | Re-detection interval (default: 1 s) | Interval for face re-detection; tracking is used frame-to-frame | | -f | Sampling frequency (default: 1 Hz) | Frequency for heart rate estimation | | -max | default: 5 | Maximum size of signal sliding window | | -min | default: 5 | Minimum size of signal sliding window | | -gui | true, false (default: true) | Display the GUI | | -log | true, false (default: false) | Detailed logging | | -ds | default: 1 | If using video from file: Downsample by using every ith frame |
License
GPL-3.0
Related Skills
docs-writer
98.9k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
333.3kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Design
Campus Second-Hand Trading Platform \- General Design Document (v5.0 \- React Architecture \- Complete Final Version)1\. System Overall Design 1.1. Project Overview This project aims t
arscontexta
2.8kClaude Code plugin that generates individualized knowledge systems from conversation. You describe how you think and work, have a conversation and get a complete second brain as markdown files you own.
