GitPedia

Heartbeat

Desktop implementation of Remote Photoplethysmography – Measuring heart rate using facial video.

From prouast·Updated June 23, 2026·View on GitHub·

Looking for more powerful and up-to-date rPPG tools? Check out our latest libraries and apps! The project is written primarily in C++, distributed under the GNU General Public License v3.0 license, first published in 2016. Key topics include: face, heart-rate, heart-rate-measurement, heart-rate-monitor, pulse.

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 LibraryFile analysis (HR, RR, HRV)G, POS, CHROM, VitalLens APIGitHub
JavaScript LibraryWebcam or file analysis (HR, RR, HRV)G, POS, CHROM, VitalLens APIGitHub
iOS SDKWebcam or file analysis (HR, RR, HRV)VitalLens APIGitHub
iOS AppWebcam processing (HR, RR)VitalLensApp Store
Rouast LabsMore about our research & techVitalLensWebsite

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:

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:

sh
$ make

Alternative compilation for Ubuntu. Works with opencv 3.1:

sh
$ 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:

ArgumentOptionsDescription
-iFilepath to input videoOmit flag to use webcam
-rppgg, pca (default: g)Specify rPPG algorithm variant - only green channel or rgb channels with pca
-facedethaar, deep (default: haar)Specify face detection classifier - Haar cascade or deep neural network
-rRe-detection interval (default: 1 s)Interval for face re-detection; tracking is used frame-to-frame
-fSampling frequency (default: 1 Hz)Frequency for heart rate estimation
-maxdefault: 5Maximum size of signal sliding window
-mindefault: 5Minimum size of signal sliding window
-guitrue, false (default: true)Display the GUI
-logtrue, false (default: false)Detailed logging
-dsdefault: 1If using video from file: Downsample by using every ith frame

License

GPL-3.0

Contributors

Showing top 4 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from prouast/heartbeat via the GitHub API.Last fetched: 6/29/2026