edge_funcs ¶
Classes:
-
dre_edgemask
–Edgemask with dynamic range enhancement prefiltering.
Functions:
dre_edgemask ¶
Bases: CustomEnum
Edgemask with dynamic range enhancement prefiltering.
Methods:
-
__call__
–Creates an edgemask with dynamic range enhancement (DRE) prefiltering.
Attributes:
CLAHE class-attribute
instance-attribute
¶
Contrast Limited Adaptive Histogram Equalization. Based on the OpenCV implementation
RETINEX class-attribute
instance-attribute
¶
Retinex-based edgemask.
__call__ ¶
__call__(
clip: VideoNode,
sigma: float = 1,
brz: float = 0.122,
operator: EdgeDetectLike = Prewitt,
*,
sigmas: Sequence[float] = [50, 200, 350],
lower_thr: float = 0.001,
upper_thr: float = 0.005,
**kwargs: Any
) -> VideoNode
__call__(
clip: VideoNode,
sigma: float = 1,
brz: float = 0.122,
operator: EdgeDetectLike = Prewitt,
**kwargs: Any
) -> VideoNode
Creates an edgemask with dynamic range enhancement (DRE) prefiltering.
This function serves as a wrapper around the retinex
and vszip.CLAHE
functions, applying one of them as a prefilter before generating the edgemask.
Parameters:
-
clip
¶VideoNode
) –Source clip.
-
sigma
¶float
, default:1
) –Standard deviation of the Gaussian kernel for edge detection. Defaults to 1.
-
brz
¶float
, default:0.122
) –Binarization threshold (32-bit float scale). Defaults to 0.122.
-
operator
¶EdgeDetectLike
, default:Prewitt
) –Edge detect operator.
-
**kwargs
¶Any
, default:{}
) –Additional keyword arguments for the selected prefilter:
- RETINEX. See retinex for details:
sigmas
: List of Gaussian sigmas for multi-scale retinex (MSR).lower_thr
: Lower threshold percentile for output normalizationupper_thr
: Upper threshold percentile for output normalization.
- CLAHE. See vszip.CLAHE for details.
limit
: Threshold for contrast limiting (32-bit float scale, unlike CLAHE plugin). Defaults to 0.0305.tile
: Tile size for histogram equalization. Defaults to 5.
- RETINEX. See retinex for details:
Returns:
-
VideoNode
–Edgemask clip with applied DRE prefiltering.
Source code in vsmasktools/edge_funcs.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
|
limited_linemask ¶
limited_linemask(
clip: VideoNode,
sigmas: list[float] = [0.000125, 0.0025, 0.0055],
detail_sigmas: list[float] = [0.011, 0.013],
edgemasks: Sequence[MaskLike] = [Kirsch],
**kwargs: Any
) -> VideoNode
Source code in vsmasktools/edge_funcs.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
luma_credit_mask ¶
luma_credit_mask(
clip: VideoNode,
thr: float = 0.9,
edgemask: MaskLike = FDoG,
draft: bool = False,
**kwargs: Any
) -> VideoNode
Source code in vsmasktools/edge_funcs.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
luma_mask ¶
Source code in vsmasktools/edge_funcs.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
ringing_mask ¶
ringing_mask(
clip: VideoNode,
rad: int = 2,
brz: float = 0.35,
thmi: float = 0.315,
thma: float = 0.5,
thlimi: float = 0.195,
thlima: float = 0.392,
credit_mask: MaskLike = Prewitt,
**kwargs: Any
) -> VideoNode
Source code in vsmasktools/edge_funcs.py
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 |
|
tcanny_retinex ¶
tcanny_retinex(
clip: VideoNode,
thr: float,
sigma: Sequence[float] = [50, 200, 350],
blur_sigma: float = 1.0,
) -> VideoNode
Source code in vsmasktools/edge_funcs.py
97 98 99 100 101 102 103 104 105 106 |
|