Skip to content
/ pulse Public

Calculate heart rate from mp4 video of thumb taken from a smartphone

Notifications You must be signed in to change notification settings

danjjl/pulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pulse - proof of concept

Calculate heart rate from mp4 video of thumb taken from a smartphone

Raw brightness

Method

  1. Calculate brightness on each frame (mean value over each pixel and RGB channel)
  2. Remove baseline fluctuations using the Asymmetric Least Squares Smoothing

FFT method

  • calculate FFT of signal
  • find frequency corresponding to maximum FFT coefficient

Heart beats per minute is given by maximum FFT frequency * 60

Spike detector

  • count positive amplitude spikes (and calculate spike occurence [spikes/minute])
  • count negateive amplitude spikes (and calculate spike occurence [spikes/minute])

Heart beats per minute is given by the average of the positive and negative spike occurence

Video

Acquired using a Nexus 4 (Ubuntu Touch OS) with the flash LED on. The current script expects a .mp4 file without a soundtrack (bitrate of the video was reduced so it could be uploaded on the web).

Dependencies

  • imageio: .mp4 processing
  • scipy
  • numpy
  • matplotlib

Detected spikes

About

Calculate heart rate from mp4 video of thumb taken from a smartphone

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages