Giter Club home page Giter Club logo

michalsindelar / bpm Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 96.39 MB

This project is an application, which detects heartbeat frequency of sampled person based on short optical record and figures the heartbeat in eye-catching form to the user. Creating algorithm for detecting the heartbeat is needed for this thesis purpose. Figuring the heartbeat frequency is inspired by Eulerian Magnification in records.

License: Other

C++ 96.87% CMake 1.18% C 1.95%

bpm's Introduction

BPM: Heartbeat detection and visualization from video source

This project is an application, which detects heartbeat frequency of sampled person based on short optical record and figures the heartbeat in eye-catching form to the user. Creating algorithm for detecting the heartbeat is needed for this thesis purpose. Figuring the heartbeat frequency is inspired by Eulerian Magnification in records.

Thesis

In documentation folder is available thesis paper in czech language with detailed information about implementation and theory behind.

Abstract

The aim of this thesis is an implementation of an application, which detects heartbeat frequency of sampled person based on short optical record and figures the heartbeat in eye-catching form to the user. Creating algorithm for detecting the heartbeat is needed for this thesis purpose. Figuring the heartbeat frequency is inspired by Eulerian Magnification in records.

Thesis at first explores physiological consequences of blood circulation in the skin, which could be suitable for detecting the heartbeat. After comparing different options is analysis of skin's hue fluctuation due to blood circulation chosen for detecting. Then theoretical describing possible technique for detecting final heartbeat from measured hue changes follows. This technique uses temporal frequency domain created with Fourier transform. Final heartbeat is gathered from found strongest frequency in acceptable beat interval set from statistical data about human heartbeat.

In practical part is described implemented application in OpenCV environment and demonstrated its functionality on input record. Also, requirements on input record are discussed here. It must have at least 500 frames with minimal sampling rate twice higher than the actual heartbeat frequency. It is very important to assure stable position of the measured face. In the end are described measurements of heartbeat from various records which accomplish input's requirements. Maximal measurement error is about 5% bpm.

Output samples

Video samples outputs are available in external cloud storage. Folders and video files are named based on real heartbeat measured via blood pressure monitor. Several files are generated in each folder such as measured csv table comparing different settings for detecting pulse, different number of used frames etc.

Screenshot sample

Further projects and visions

  • BPMonitor
    • Experimental application to monitor heart rate during work in front of notebook using integrated camera, which informs user about potential dangerous heart rate.
  • Awake Monitor
    • Vision how to prevent driver to fall asleep via heart rate monitoring.
  • SMirror
    • Long time vision of smart mirror with face detection authentication, heart rate detect, widgets on dashbord and lot more.

Dependencies

  • C++
  • OpenCv > 2
    • --with-ffmpeg support
    • --with-qt support
  • Qt5 framework
  • CMake > 3

How to run

Install all dependencies at first. You can try run executable file bpm on OS X.

Unix based system

Prefered way with brew (linuxbrew).

brew install opencv -v --with-ffmpeg --with-qt --c++11

brew install qt5

brew linkapps qt5

brew install moc - auto mock needed for qt


App is compiled via CMake. Navigate to app in terminal folder. Folder must be writable, you could run:

chmod 777 ./

Then run following commands:

cmake .

make

./bpm

For better performance you could try increasing priority of process especially when using webcamera.

$ nice -n -10 ./bpm

Enjoy!

TODO list

[ ] Fix Windows compatibility

bpm's People

Contributors

michalsindelar avatar

Stargazers

tokuin avatar Sean Stevens avatar Poverty avatar Camilo avatar Blair Neal avatar Bence Nagy avatar Pavel 'Strajk' Dolecek avatar

Watchers

James Cloos avatar  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.