Motiontempo¶
mg_motiontempo ¶
mg_motiontempo(self, fmin=0.2, fmax=8.0, dpi=300, autoshow=True, title=None, target_name=None, overwrite=True)
Estimates the dominant movement tempo of a video from its quantity of motion.
A quantity-of-motion (QoM) signal is computed as the mean absolute difference
between consecutive frames. Its dominant periodicity within [fmin, fmax] is
found with an FFT and reported both in Hz and in beats per minute (BPM), giving a
simple estimate of the overall movement tempo (e.g. step rate of a dancer).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fmin
|
float
|
Lowest movement frequency to consider (Hz). Defaults to 0.2. |
0.2
|
fmax
|
float
|
Highest movement frequency to consider (Hz). Defaults to 8.0. |
8.0
|
dpi
|
int
|
Image quality of the rendered figure in DPI. Defaults to 300. |
300
|
autoshow
|
bool
|
Whether to show the resulting figure automatically. Defaults to True. |
True
|
title
|
str
|
Optionally add a title to the figure. Use 'filename' for the file name. Defaults to None. |
None
|
target_name
|
str
|
The name of the output image. Defaults to None (which uses the input filename with the suffix "_motiontempo.png"). |
None
|
overwrite
|
bool
|
Whether to allow overwriting existing files or to automatically increment the target filename. Defaults to True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
MgFigure |
MgFigure
|
An MgFigure object. Numeric results are available in |
Source code in musicalgestures/_motiontempo.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |