Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios detect heart rate [duplicate]

Tags:

ios

Possible Duplicate:
Detecting heart rate using the camera

I need the same functionality as the application Instant Heart Rate.

The basic process requires the user to:

Place the tip of the index finger gently on the camera lens. Apply even pressure and cover the entire lens. Hold it steady for 10 seconds and get the heart rate. This can be accomplished by turning the flash on and watch the light change as the blood moves through the index finger.

how can i start

like image 979
AITAALI_ABDERRAHMANE Avatar asked Jan 21 '13 15:01

AITAALI_ABDERRAHMANE


1 Answers

I'd start by using AVFoundation to turn the light on. The answers in the linked post below include examples of how to do this:

How to turn the iPhone camera flash on/off?

Then as far as detecting the light change goes, you can probably use Brad Larson's GPUImage Framework. This framework includes a couple of helpful functions that you may be able to use to achieve this, including:

  1. GPUImageAverageLuminanceThresholdFilter
  2. GPUImageAverageColor
  3. GPUImageLuminosity

Using the filters listed above you should be able to measure color variations in your finger, and monitor the time intervals between the occurrences of these changes. Using this framework you may even be able to specify an arbitrary variance requirement for the color/luminosity change.

From there all you have to do is convert the time interval in between the color changes to a pulse. Here's an example of how to calculate pulse.

http://www.wikihow.com/Calculate-Your-Target-Heart-Rate

like image 198
Mick MacCallum Avatar answered Nov 06 '22 10:11

Mick MacCallum