prefilters ¶
This module implements prefilters for denoisers
Classes:
-
MultiPrefilter
– -
Prefilter
–Enum representing available filters.
Functions:
-
prefilter_to_full_range
–Converts a clip to full range if necessary and amplifies dark areas.
MultiPrefilter ¶
MultiPrefilter(*prefilters: Prefilter)
PrefBase ¶
Prefilter ¶
Bases: PrefilterBase
Enum representing available filters.
These are mainly thought of as prefilters for :py:attr:MVTools
, but can be used standalone as-is.
Methods:
-
__call__
–
Attributes:
-
BILATERAL
–Classic bilateral filtering or edge-preserving bilateral multi pass filtering.
-
BM3D
–Normal spatio-temporal denoising using BM3D.
-
DFTTEST
–Denoising in frequency domain with dfttest and an adaptive mask for retaining details.
-
FLUXSMOOTHST
–Perform smoothing using
zsmooth.FluxSmoothST
-
GAUSS
–Gaussian blur.
-
MINBLUR
–Minimum difference of a gaussian/median blur
-
NLMEANS
–Denoising with NLMeans.
-
NONE
–Don't do any prefiltering. Returns the clip as-is.
BILATERAL class-attribute
instance-attribute
¶
BILATERAL = 6
Classic bilateral filtering or edge-preserving bilateral multi pass filtering.
DFTTEST class-attribute
instance-attribute
¶
DFTTEST = 3
Denoising in frequency domain with dfttest and an adaptive mask for retaining details.
FLUXSMOOTHST class-attribute
instance-attribute
¶
FLUXSMOOTHST = 2
Perform smoothing using zsmooth.FluxSmoothST
MINBLUR class-attribute
instance-attribute
¶
MINBLUR = 0
Minimum difference of a gaussian/median blur
NONE class-attribute
instance-attribute
¶
NONE = 0
Don't do any prefiltering. Returns the clip as-is.
__call__ ¶
__call__(
clip: VideoNode,
/,
*,
full_range: bool | float = False,
temp_thr: float | Sequence[float] = 2.0,
spat_thr: float | Sequence[float] | None = 2.0,
) -> VideoNode
__call__(
clip: VideoNode,
/,
planes: PlanesT = None,
full_range: bool | float = False,
*,
sloc: SLocT | None = {0.0: 4.0, 0.2: 9.0, 1.0: 15.0},
pref_mask: VideoNode | Literal[False] | tuple[int, int] = (16, 75),
tbsize: int = 1,
sbsize: int = 12,
sosize: int = 6,
swin: int = 2,
**kwargs: Any,
) -> VideoNode
__call__(
clip: VideoNode,
/,
planes: PlanesT = None,
full_range: bool | float = False,
*,
strength: SingleOrArr[float] = 7.0,
tr: SingleOrArr[int] = 1,
sr: SingleOrArr[int] = 2,
simr: SingleOrArr[int] = 2,
device_type: DeviceType = AUTO,
**kwargs: Any,
) -> VideoNode
__call__(
clip: VideoNode,
/,
planes: PlanesT = None,
full_range: bool | float = False,
*,
arch: type[AbstractBM3D] = ...,
gpu: bool | None = None,
sigma: SingleOrArr[float] = ...,
tr: SingleOrArr[int] = 1,
profile: Profile = ...,
ref: VideoNode | None = None,
refine: int = 1,
) -> VideoNode
__call__(
clip: VideoNode,
/,
planes: PlanesT = None,
full_range: bool | float = False,
*,
sigmaS: float | list[float] | tuple[float | list[float], ...] = 3.0,
sigmaR: float | list[float] | tuple[float | list[float], ...] = 0.02,
gpu: bool | None = None,
**kwargs: Any,
) -> VideoNode
__call__(
clip: VideoNode,
/,
planes: PlanesT = None,
full_range: bool | float = False,
**kwargs: Any,
) -> VideoNode
__call__(
*,
full_range: bool | float = False,
temp_thr: float | Sequence[float] = 2.0,
spat_thr: float | Sequence[float] | None = 2.0
) -> PrefilterPartial
__call__(
*,
planes: PlanesT = None,
full_range: bool | float = False,
sloc: SLocT | None = {0.0: 4.0, 0.2: 9.0, 1.0: 15.0},
pref_mask: VideoNode | Literal[False] | tuple[int, int] = (16, 75),
tbsize: int = 1,
sbsize: int = 12,
sosize: int = 6,
swin: int = 2,
**kwargs: Any
) -> PrefilterPartial
__call__(
*,
planes: PlanesT = None,
full_range: bool | float = False,
strength: SingleOrArr[float] = 7.0,
tr: SingleOrArr[int] = 1,
sr: SingleOrArr[int] = 2,
simr: SingleOrArr[int] = 2,
device_type: DeviceType = AUTO,
**kwargs: Any
) -> PrefilterPartial
__call__(
*,
planes: PlanesT = None,
full_range: bool | float = False,
arch: type[AbstractBM3D] = ...,
gpu: bool = False,
sigma: SingleOrArr[float] = ...,
radius: SingleOrArr[int] = 1,
profile: Profile = ...,
ref: VideoNode | None = None,
refine: int = 1
) -> PrefilterPartial
__call__(
*,
planes: PlanesT = None,
full_range: bool | float = False,
sigmaS: float | list[float] | tuple[float | list[float], ...] = 3.0,
sigmaR: float | list[float] | tuple[float | list[float], ...] = 0.02,
gpu: bool | None = None,
**kwargs: Any
) -> VideoNode
__call__(
*, planes: PlanesT = None, full_range: bool | float = False, **kwargs: Any
) -> PrefilterPartial
__call__(
*, planes: PlanesT = None, full_range: bool | float = False, **kwargs: Any
) -> PrefilterPartial
__call__(
clip: VideoNode | MissingT = MISSING,
/,
planes: PlanesT = None,
full_range: bool | float = False,
**kwargs: Any,
) -> VideoNode | PrefilterPartial
Source code
488 489 490 491 492 |
|
PrefilterBase ¶
Bases: CustomIntEnum
Methods:
-
__call__
–
__call__ ¶
__call__(
*, planes: PlanesT = None, full_range: bool | float = False, **kwargs: Any
) -> PrefilterPartial
__call__(
clip: VideoNode | MissingT = MISSING,
/,
planes: PlanesT = None,
full_range: bool | float = False,
**kwargs: Any,
) -> VideoNode | PrefilterPartial
Source code
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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|
PrefilterMeta ¶
Bases: EnumMeta
PrefilterPartial ¶
Bases: PrefBase
Methods:
-
__call__
–
Attributes:
Source code
504 505 506 507 |
|
__call__ ¶
Source code
509 510 511 512 513 514 |
|
prefilter_to_full_range ¶
Converts a clip to full range if necessary and amplifies dark areas. Essentially acts like a luma-based multiplier on the SAD when used as an mvtools prefilter.
Parameters:
-
clip
¶VideoNode
) –Clip to process.
-
slope
¶float
, default:2.0
) –Slope to amplify the scale of the dark areas relative to bright areas.
-
smooth
¶float
, default:0.0625
) –Indicates the length of the transition between the amplified dark areas and normal range conversion.
Returns:
-
VideoNode
–Range expanded clip.
Source code
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
|