Coder Social home page Coder Social logo

heartbeat's Introduction

Heartbeat

Heartbeat is a software to measure heart rate using a camera.

Based on "Measuring heart rate with a smartphone camera". Source code.

Introduction

When the blood flows through the tip of your finger, your finger's opacity varies. If you cover your smartphone's camera with your finger the image turns red. If you watch closely you can notice that the screen 'pulses'. If your screen is too dark try aiming at a light source or turning on the flashlight.

The objective of Heartbeat is to measure heart rate using a smartphone camera. It's based on the fact explained in the previous paragraph. It measures the screen's mean brightness and uses Fourier transform to find the frequencies of the oscillation.

Requirements

  • OpenCV-Python v3.2
  • Numpy v1.12
  • SciPy v0.19
  • Matplotlib v2.0
  • Python v3.5

Versions tested. Probably works with previous versions.

How to use

For now, Heartbeat has a very simple command-line interface.

1) Get source code

git clone https://github.com/matheuscarius/heartbeat.git
cd heartbeat

2) Run the program

python3 heartbeat <path to video file>

Example

There is a sample video inside the data/ folder

Run sample video

python3 heartbeat data/vid.mp4

Additional information

You may want to downscale your video before running Heartbeat to improve performance. High resolutions are not required for Heartbeat to work, 320x240 is sufficient.

You can use tools like ffmpeg, mencoder, avconv, VLC Media Player, etc. to downscale a video.

heartbeat's People

Contributors

math-castro 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.