Heartbeat is a software to measure heart rate using a camera.
Based on "Measuring heart rate with a smartphone camera". Source code.
When the blood flows through the tip of your finger, your finger's opacity varies. If you cover your smartphone's camera with your finger the image turns red. If you watch closely you can notice that the screen 'pulses'. If your screen is too dark try aiming at a light source or turning on the flashlight.
The objective of Heartbeat is to measure heart rate using a smartphone camera. It's based on the fact explained in the previous paragraph. It measures the screen's mean brightness and uses Fourier transform to find the frequencies of the oscillation.
OpenCV-Python v3.2
Numpy v1.12
SciPy v0.19
Matplotlib v2.0
Python v3.5
Versions tested. Probably works with previous versions.
For now, Heartbeat has a very simple command-line interface.
git clone https://github.com/matheuscarius/heartbeat.git
cd heartbeat
python3 heartbeat <path to video file>
There is a sample video inside the data/
folder
python3 heartbeat data/vid.mp4
You may want to downscale your video before running Heartbeat to improve performance. High resolutions are not required for Heartbeat to work, 320x240 is sufficient.
You can use tools like ffmpeg, mencoder, avconv, VLC Media Player, etc. to downscale a video.