必须先自行安装 OpenCV 并确保编译器能找到其头文件和库;Makefile 仅适用于 macOS,Ubuntu 需用 README 给出的 g++ 命令手动编译(对应 opencv 3.1);不传 -i 参数时默认调用摄像头。
heartbeat
prouastGPL-3.0更新放缓用普通摄像头拍摄人脸视频就能测心率,基于远程光电容积描记(rPPG)技术的桌面端实现,适合做非接触式生理监测。
Desktop implementation of Remote Photoplethysmography – Measuring heart rate using facial video.
makeREADME 未说明具体 CPU/GPU 或显存要求;需系统安装 OpenCV,且头文件与库需位于编译器标准搜索路径。
用面部视频做非接触式心率测量的 C++ 桌面实现,基于 rPPG 分析肤色细微变化
用普通摄像头拍摄人脸视频就能测心率,基于远程光电容积描记(rPPG)技术的桌面端实现,适合做非接触式生理监测。
核心能力
- 检测并逐帧跟踪人脸,提取每帧面部颜色构成信号序列
- 用频率分析与滤波从信号序列估计心率
- 支持绿通道与 RGB+PCA 两种 rPPG 算法变体
- 可选 Haar 级联或深度神经网络人脸检测器
- 支持摄像头实时输入或读取视频文件并降采样
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
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