Remote pulse rate measurement from facial video has gained particular attention over the last few years. Researches exhibit significant advancements and demonstrate that common video cameras correspond to reliable devices that can be employed to measure a large set of biomedical parameters without any contact with the subject.
This repository contains the source codes related to a method based on a prior selection of pixels of interest using a custom segmentation that used the face lightness distribution to define different sub-regions. The most relevant sub-regions are automatically selected and combined by evaluating their respective signal to noise ratio.
If you find this code useful or use it in an academic or research project, please cite it as:
Frédéric Bousefsaf, Choubeila Maaoui, Alain Pruski, Automatic selection of webcam photoplethysmographic pixels based on lightness criteria, Journal of Medical and Biological Engineering, vol. 37, n° 3, pp. 374–385 (2017). Link
You can also visit my website for additional information.
Please refer to the original publication to get all the details. The method automatically selects different regions of pixels based on the lightness distribution of the face. The signal to noise ratio of each region is computed using a standard power spectral density analysis. The most relevant regions are then automatically selected and combined by evaluating their respective signal to noise ratio. To avoid artifacts generated during lips movements, only the upper part of the face was selected as first ROI.
Overview of the method.
The codes were tested with Python 3.5/3.6. Different packages must be installed to properly run the codes :
pip install numpy
pip install scipy
pip install cmake
pip install dlib
pip install opencv-python
pip install matplotlib
A test sample is available here (sample_front.zip). The folder contains the time vector along with uncompressed images. Please remove the file times.txt
from the folder before testing. The program first displays a GUI upon execution of ippg_lightness_segmentation.py
. The folder containing only the raw images can be selected. PPG signal with the best signal-to-noise ratio is automatically displayed at the end of the procedure (see the example below).
Results computed from sample data.