Image Component Library (ICL)
|
Heartrate Detector. More...
#include <HeartrateDetector.h>
Public Member Functions | |
HeartrateDetector (int framerate=30, int historyDepth=512) | |
Default constructor with given arguments. More... | |
void | addImage (const core::Img8u &image) |
Add an image to the detector to use in the estimation. More... | |
float | getHeartrate () const |
qt::PlotWidget::SeriesBuffer | getFrequencies () const |
returns a SeriesBuffer for visualization of the frequencies. More... | |
qt::PlotWidget::SeriesBuffer | getAveragedFrequencies () const |
qt::PlotWidget::SeriesBuffer | getWindowBuffer () const |
int | getFramerate () const |
returns the framerate More... | |
int | getHistoryDepth () const |
returns the history depth More... | |
virtual | ~HeartrateDetector () |
Destructor. More... | |
Private Attributes | |
Data * | m_data |
internal data structure More... | |
Additional Inherited Members | |
Protected Member Functions inherited from icl::utils::Uncopyable | |
Uncopyable () | |
Empty base constructor. More... | |
Heartrate Detector.
Implementation of a simple heartrate detector using video material of a face.
The algorithm takes images cropped to the same part of the face as an input and estimates the heartrate using a Fast Fourier Transformation over the average green value of the past few frames.
Parameters for the algorithm are:
historyDepth denotes how many frames are sampled before the algorithm starts estimating the heartrate. Using a larger historyDepth allows for a more fine grained estimation of the heartrate, but introduces a bigger delay before a first estimate can be given.
usage example:
icl::cv::HeartrateDetector::HeartrateDetector | ( | int | framerate = 30 , |
int | historyDepth = 512 |
||
) |
Default constructor with given arguments.
|
virtual |
Destructor.
void icl::cv::HeartrateDetector::addImage | ( | const core::Img8u & | image | ) |
Add an image to the detector to use in the estimation.
qt::PlotWidget::SeriesBuffer icl::cv::HeartrateDetector::getAveragedFrequencies | ( | ) | const |
returns a SeriesBuffer for visualization of the averaged frequencies over the last second.
int icl::cv::HeartrateDetector::getFramerate | ( | ) | const |
returns the framerate
qt::PlotWidget::SeriesBuffer icl::cv::HeartrateDetector::getFrequencies | ( | ) | const |
returns a SeriesBuffer for visualization of the frequencies.
float icl::cv::HeartrateDetector::getHeartrate | ( | ) | const |
returns the current estimate for the heartrate. Will return 0 if no enough enough samples have been provided.
int icl::cv::HeartrateDetector::getHistoryDepth | ( | ) | const |
returns the history depth
qt::PlotWidget::SeriesBuffer icl::cv::HeartrateDetector::getWindowBuffer | ( | ) | const |
returns a buffer that marks the current window of frequencies that is considered for the estimation of the heartrate.
|
private |
internal data structure
internal data pointer