Wednesday, 22 May 2013

Heart rate monitor demo

Some students have been interested recently in using image processing for physiological monitoring. To explain some concepts I put together a simple demo for measuring heart rate with a webcam, using Python and OpenCV.

As the oxygen levels in the blood change, its light absorption alters. If a light is shone through a finger onto a webcam, these changes can be picked up (apparently it can even be done by the colour of the skin on the forehead), so that a pulse waveform can be obtained.

The Python script can be downloaded here (requires opencv and numpy). In order to get good results, the frame rate of the camera should be set to 20-30 FPS (on Linux this can be done with guvcview). The challenge with using this in practice is to keep the finger very still...