Method
How the number is made
Three steps turn a video of a face into beats per minute. All of them run in this tab; the signal processing is a small Rust library compiled to WebAssembly.
-
–
Fig. 1 Color, averaged in three skin regions. Every frame, the skin pixels inside the three outlines are averaged into one color, shown here live. It looks constant: the pulse moves it by well under one percent. -
Fig. 2 The pulse signal (POS). The color series, resampled to 30 samples a second, is projected so that brightness changes shared by all three channels – auto-exposure, a passing cloud – cancel out, while the tint of blood remains. Filtered to 42–240 BPM; with a clean signal, each crest is one beat. -
Fig. 3 The strongest rhythm becomes the number. A Fourier transform of the last 10 s shows how strongly the signal repeats at each rate. The highest peak is the estimate; how far it and its first harmonic stand out from the rest sets the quality (good from 3 dB, fair from 0 dB).
Known limits. Melanin absorbs more of the light, so the signal is weaker on darker skin. Beards, makeup, glare on glasses, dim or flickering light, movement and talking all degrade it too. Under strongly colored light the skin mask switches off, and camera white-balance shifts, which change the channels unevenly, are not canceled by the projection in Fig. 2. The thresholds are still tuned on synthetic data.