src package

Submodules

src.hr_estimation module

src.hr_estimation.find_heart_rate(fft, freqs, freq_min, freq_max)

desc: compute HR from FFT peaks

Parameters
  • fft::[] (-) –

  • freqs::[] (-) –

  • freq_min::[] (-) –

  • freq_max::[] (-) –

ret:
  • HR::[float]

    heart-rate

src.hr_estimation.get_hr_welch(signal, fps, minFreq=0.75, maxFreq=3.7)

desc:

args:

ret:

src.hr_estimation.get_rfft_hr(signal, framerate, minFreq=0.75, maxFreq=3.7)

desc:

args:

ret:

src.signal_utils module

src.signal_utils.BPfilter(x, minHz, maxHz, fs, order=6)

desc: filtering out frequency that is in the desired interval

Parameters
  • x::[array<float>] (-) – signal

  • minHz::[float] (-) –

  • maxHz::[float] (-) –

  • fs::[int] (-) – sampling rate

ret:

src.signal_utils.detrend(X, detLambda=10)

desc: get rid of a randomness trend might deal with sudden increase trend coming from head movements

Parameters

X::[array<float>] (-) – signal

ret:
  • detrendedX::[array<float>]

    detrended signal

src.signal_utils.fft_filter(video, freq_min, freq_max, fps)
src.signal_utils.normalize(array)
src.signal_utils.zeroMeanSTDnorm(x)

desc: mean/std normalizing

Parameters

x::[array<float>] (-) – signal

ret:
  • y::[array<float>]

src.utils module

src.utils.color_mapping(img, scheme='HSV')

desc: map general RGB to other coloring scheme e.g YUV, HSV

Parameters
  • >] (- img::[array<array<int>) –

  • scheme::[str] (-) –

ret:
  • mapped::[array<array<int> >]

src.utils.get_window_hr(signal_df, fpe, window=2)

desc: estimate-hr from a window interval belonging to stream of signal dataframe

Parameters
  • signal_df::[dataframe] (-) –

  • fpe::[float] (-) –

  • windows::[int] (-) –

ret:
  • ret::[dict]

    described below

  • step::[int]

    window length

src.utils.img2uint8(img)
src.utils.overlap_add(signal, wsize=3)

desc: smoothen a signal by adding to part of itself to other intervals

Parameters

signal::[array<float>] (-) – signal to be overlapp added

ret:
  • overlapped::[array<float>]

src.utils.plot_channelcomp(img)
desc: plot distribution of values in each channel

to check when doing color filtering for segmentation

Parameters

img::[array<int>] (-) –

ret:
  • None

src.utils.recthull(points)
desc: from some points, get the bbox including all

pixels from the delimiting points

Parameters

>] (- points::[array <array<int>) –

ret:
  • x,y,w,h::[tuple<int>]

Module contents