Input Test¶
Error ¶
Bases: Exception
Base class for exceptions in this module.
InputError ¶
InputError(message)
Bases: Error
Exception raised for errors in the input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Explanation of the error. |
required |
Source code in musicalgestures/_input_test.py
16 17 | |
mg_input_test ¶
mg_input_test(filename, array, fps, filtertype, threshold, starttime, endtime, blur, skip, frames)
Gives feedback to user if initialization from input went wrong.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Path to the input video file. |
required |
array
|
ndarray
|
Generates an MgVideo object from a video array. Defauts to None. |
required |
fps
|
float
|
The frequency at which consecutive images from the video array are captured or displayed. Defauts to None. |
required |
filtertype
|
str
|
'Regular' turns all values below |
required |
threshold
|
float
|
A number in the range of 0 to 1. Eliminates pixel values less than given threshold. |
required |
starttime
|
int / float
|
Trims the video from this start time (s). |
required |
endtime
|
int / float
|
Trims the video until this end time (s). |
required |
blur
|
str
|
'Average' to apply a 10px * 10px blurring filter, 'None' otherwise. |
required |
skip
|
int
|
Every n frames to discard. |
required |
frames
|
int
|
Specify a fixed target number of frames to extract from the video. |
required |
Raises:
| Type | Description |
|---|---|
InputError
|
If the types or options are wrong in the input. |
Source code in musicalgestures/_input_test.py
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 | |