❤️ A heart rate camera pulse detector written in Swift.
The Pulse app uses the back main wide camera of your iPhone and measures your heart rate pulse.
CMSampleBuffer
from every frame with the protocol of AVCaptureVideoDataOutputSampleBufferDelegate
.Timer()
with TimeInterval
at one (1) second and get the average value of the pulse's periods.When extracting the HSV values we increment a validFrameCounter
for identifying if the index finger is placed correctly in the back camera.
If it is above 60 then we process the Hue value with the filter.
The pulse detector gives us a threshold for pulse to -60 in order to know when to display an error message or the actual bpm value.
Special thanks to Gurpreet Singh from Pubnub(read that carefully 😅) for creating the Filter and PulseDetector in Obj-C.