y5gfunc.filter.stripe¶
stripe
¶
Functions:
| Name | Description |
|---|---|
is_stripe |
Detects scenes potentially containing strong vertical stripes using FFT analysis. |
is_stripe
¶
is_stripe(clip: VideoNode, threshold: Union[float, int] = 2, freq_range: Union[int, float] = 0.25, scenecut_threshold: Union[float, int] = 0.1) -> VideoNode
Detects scenes potentially containing strong vertical stripes using FFT analysis.
This function analyzes the frequency spectrum of each frame to identify scenes where the energy in high vertical frequencies significantly outweighs the energy in high horizontal frequencies. This pattern is often indicative of vertical stripes.
The analysis is performed per scene, meaning the ratio of vertical to horizontal frequency energy is averaged over all frames within a detected scene. All frames in that scene are then marked based on this average ratio.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VideoNode
|
Input video clip. Must be 32-bit per sample. |
required |
|
Union[float, int]
|
The threshold for the ratio of average vertical high-frequency energy to average horizontal high-frequency energy within a scene. If a scene's ratio exceeds this value, it's marked as potentially containing stripes. |
2
|
|
Union[int, float]
|
Defines the proportion of the spectrum (from each edge towards the center) considered as "high frequency". For example, 0.25 means the outer 25% of frequencies horizontally and vertically are analyzed. Must be between 0 and 0.5 (exclusive of 0, inclusive of 0.5 isn't practically useful). |
0.25
|
|
Union[float, int]
|
Threshold used for scene change detection via |
0.1
|
Returns:
| Type | Description |
|---|---|
VideoNode
|
The input clip with a frame property |
Raises:
| Type | Description |
|---|---|
ValueError
|
If input clip is not 32-bit per sample. |
ValueError
|
if freq_range is not between 0 and 0.5. |
Source code in y5gfunc/filter/stripe.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 | |