Webcam Pulse Detector

Simple Python-based application takes the video feed from your webcam and uses it to determine your heart rate. How? Every time your heart beats, it pulses in your forehead. Isolating the forehead region of the image and amplifying subtle shifts in the green channel lets the software lock on to your pulse and produce a reading.

The webcam is even able to look for Mayer waves (Traube-Hering-Mayer waves), an 0.1Hz modulation in blood pressure. (W. Ludwig referred to this as the Nogier frequency.)

Security applications: Can you say lie detector? Specifically, surreptitiously tracking peoples’ physiological reactions — no doubt coming to some malware near you as a negotiation aid among Internet criminals.

Just one more reason not to have a webcam, or tape over it if you can’t unplug it.

“A python application that detects the heart-rate of an individual using their computer’s webcam. Tested on OSX 10.7 (Lion), Ubuntu 13.04 (Ringtail), and Windows 7.[…]

This application uses openCV ( to find the location of the user’s face, then isolate the forehead region. Data is collected from this location over time to estimate the user’s heartbeat frequency. This is done by measuring average optical intensity in the forehead location, in the subimage’s green channel alone (a better color mixing ratio may exist, but the blue channel tends to be very noisy). Physiological data can be estimated this way thanks to the optical absorbtion characteristics of (oxy-) hemoglobin (see

With good lighting and minimal noise due to motion, a stable heartbeat should be isolated in about 15 seconds. Other physiological waveforms, such as Mayer waves (, should also be visible in the raw data stream.

Once the user’s pulse signal has been isolated, real-time phase variation associated with the detected hearbeat frequency is also computed. This allows for the heartbeat frequency to be exaggerated in the post-process frame rendering, causing the highlighted forhead location to pulse in sync with the user’s own heartbeat.”

%d bloggers like this: