Git Product home page Git Product logo

pulse's Introduction


Logo

Pulse ❤️

The Pulse app uses the back main wide camera of your iPhone and measures your heart rate pulse.

🤔 How it works?

  1. We initialize a Video Capture object from the back camera with a frame of 300x300 and 30fps.
  2. We extract the CMSampleBuffer from every frame with the protocol of AVCaptureVideoDataOutputSampleBufferDelegate.
  3. From this frame, we get the RGB (Red Green Blue) mean values of every pixel.
  4. We convert the RGB values to HSV (Hue Saturation Value), in order to make the model work.
  5. We isolate the Hue component and process it with a simple Band-pass filter.
    The filter just removes any DC component and any high frequency noise from the value.
  6. We create a simple Timer() with TimeInterval at one (1) second and get the average value of the pulse's periods.
  7. Then, if we devide that average value by 60, we have our heart rate pulse.
    60 because the heart rate pulse is measured in bpms (Beats of the heart per minute).

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.

⚙️ Requirements

  • iOS 12.0+
  • Xcode 10.0+

📲 Installation

  1. Download the project and build it with your development team.
  2. Congratulations 🎉!

🙏 Contribution

Special thanks to Gurpreet Singh from Pubnub(read that carefully 😅) for creating the Filter and PulseDetector in Obj-C.

📃 License

MIT

pulse's People

Contributors

thanospapazoglou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.