edge ¶
Masks derived from edge detectors.
Modules:
-
_1d
–1D matrices
-
_3x3
–2D matrices.
-
_5x5
–2D matrices.
-
_abstract
–
Classes:
-
ASobel
–Modified Sobel-Feldman operator from AWarpSharp.
-
Cross
–"HotDoG" Operator from AVS ExTools by Dogway.
-
EdgeDetect
–Abstract edge detection interface.
-
EuclideanDistance
– -
ExKirsch
–Extended Russell Kirsch compass operator. 5x5 matrices.
-
ExLaplacian1
–Extended Pierre-Simon de Laplace operator, 1st implementation.
-
ExLaplacian2
–Extended Pierre-Simon de Laplace operator, 2nd implementation.
-
ExLaplacian3
–Extended Pierre-Simon de Laplace operator, 3rd implementation.
-
ExLaplacian4
–Extended Pierre-Simon de Laplace operator, 4th implementation.
-
ExPrewitt
–Extended Judith M. S. Prewitt operator.
-
ExSobel
–Extended Sobel-Feldman operator.
-
FDoG
–Flow-based Difference of Gaussian
-
FDoGTCanny
–Flow-based Difference of Gaussian TCanny Vapoursynth plugin.
-
Farid
–Farid & Simoncelli operator.
-
FreyChen
–Chen Frei operator. 3x3 matrices properly implemented.
-
FreyChenG41
–"Chen Frei" operator. 3x3 matrices from G41Fun.
-
Kayyali
–Kayyali operator.
-
Kirsch
–Russell Kirsch compass operator.
-
KirschTCanny
–Russell Kirsch compass TCanny Vapoursynth plugin operator.
-
Kroon
–Dirk-Jan Kroon operator.
-
KroonTCanny
–Dirk-Jan Kroon TCanny Vapoursynth plugin operator.
-
Laplacian1
–Pierre-Simon de Laplace operator 1st implementation.
-
Laplacian2
–Pierre-Simon de Laplace operator 2nd implementation.
-
Laplacian3
–Pierre-Simon de Laplace operator 3rd implementation.
-
Laplacian4
–Pierre-Simon de Laplace operator 4th implementation.
-
LoG
–Laplacian of Gaussian operator.
-
MagDirection
–Direction of magnitude calculation.
-
MagnitudeMatrix
– -
Matrix1D
– -
Matrix3x3
– -
Matrix5x5
– -
MatrixEdgeDetect
– -
Max
– -
MinMax
–Min/max mask with separate luma/chroma radii.
-
Prewitt
–Judith M. S. Prewitt operator.
-
PrewittStd
–Judith M. S. Prewitt Vapoursynth plugin operator.
-
PrewittTCanny
–Judith M. S. Prewitt TCanny plugin operator.
-
RScharr
–Refined H. Scharr operator to more accurately calculate
-
RidgeDetect
– -
Robinson3
–Robinson compass operator level 3.
-
Robinson5
–Robinson compass operator level 5.
-
Scharr
–Original H. Scharr optimised operator which attempts
-
ScharrTCanny
–H. Scharr optimised TCanny Vapoursynth plugin operator.
-
SingleMatrix
– -
Sobel
–Sobel-Feldman operator.
-
SobelStd
–Sobel-Feldman Vapoursynth plugin operator.
-
SobelTCanny
–Sobel-Feldman Vapoursynth plugin operator.
-
TEdge
–(TEdgeMasktype=2) Avisynth plugin.
-
TEdgeTedgemask
–(tedgemask.TEdgeMask(threshold=0.0, type=2)) Vapoursynth plugin.
-
TheToof
–TheToof compass operator from SharpAAMCmod.
-
Tritical
–Operator used in Tritical's original TCanny filter.
-
TriticalTCanny
–Operator used in Tritical's original TCanny filter.
Functions:
-
get_all_edge_detects
–Returns all the EdgeDetect subclasses
-
get_all_ridge_detect
–Returns all the RidgeDetect subclasses
Attributes:
-
EdgeDetectLike
(TypeAlias
) –Type alias for anything that can resolve to a EdgeDetect.
-
EdgeDetectT
–Deprecated alias of EdgeDetectLike.
-
RidgeDetectLike
(TypeAlias
) –Type alias for anything that can resolve to a RidgeDetect.
-
RidgeDetectT
–Deprecated alias of RidgeDetectLike.
EdgeDetectLike module-attribute
¶
EdgeDetectLike: TypeAlias = type[EdgeDetect] | EdgeDetect | str
Type alias for anything that can resolve to a EdgeDetect.
This includes
- A string identifier.
- A class type subclassing
EdgeDetect
. - An instance of a
EdgeDetect
.
RidgeDetectLike module-attribute
¶
RidgeDetectLike: TypeAlias = type[RidgeDetect] | RidgeDetect | str
Type alias for anything that can resolve to a RidgeDetect.
This includes
- A string identifier.
- A class type subclassing
RidgeDetect
. - An instance of a
RidgeDetect
.
ASobel ¶
ASobel(**kwargs: Any)
Bases: Matrix3x3
, EdgeDetect
Modified Sobel-Feldman operator from AWarpSharp.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Cross ¶
Cross(**kwargs: Any)
Bases: RidgeDetect
, EuclideanDistance
, Matrix3x3
"HotDoG" Operator from AVS ExTools by Dogway. Plain and simple cross first order derivative.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[1, 0, 0, 0, 0, 0, 0, 0, -1],
[0, 0, -1, 0, 0, 0, 1, 0, 0],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
EdgeDetect ¶
EdgeDetect(**kwargs: Any)
Bases: ABC
Abstract edge detection interface.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
EuclideanDistance ¶
EuclideanDistance(**kwargs: Any)
Bases: MatrixEdgeDetect
, ABC
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ExKirsch ¶
ExKirsch(mag_directions: MagDirection = ALL, **kwargs: Any)
Bases: MagnitudeMatrix
, Max
Extended Russell Kirsch compass operator. 5x5 matrices.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
mag_directions
– -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
306 307 308 309 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[
9,
9,
9,
9,
9,
9,
5,
5,
5,
9,
-7,
-3,
0,
-3,
-7,
-7,
-3,
-3,
-3,
-7,
-7,
-7,
-7,
-7,
-7,
],
[
9,
9,
9,
9,
-7,
9,
5,
5,
-3,
-7,
9,
5,
0,
-3,
-7,
9,
-3,
-3,
-3,
-7,
-7,
-7,
-7,
-7,
-7,
],
[
9,
9,
-7,
-7,
-7,
9,
5,
-3,
-3,
-7,
9,
5,
0,
-3,
-7,
9,
5,
-3,
-3,
-7,
9,
9,
-7,
-7,
-7,
],
[
-7,
-7,
-7,
-7,
-7,
9,
-3,
-3,
-3,
-7,
9,
5,
0,
-3,
-7,
9,
5,
5,
-3,
-7,
9,
9,
9,
9,
-7,
],
[
-7,
-7,
-7,
-7,
-7,
-7,
-3,
-3,
-3,
-7,
-7,
-3,
0,
-3,
-7,
9,
5,
5,
5,
9,
9,
9,
9,
9,
9,
],
[
-7,
-7,
-7,
-7,
-7,
-7,
-3,
-3,
-3,
9,
-7,
-3,
0,
5,
9,
-7,
-3,
5,
5,
9,
-7,
9,
9,
9,
9,
],
[
-7,
-7,
-7,
9,
9,
-7,
-3,
-3,
5,
9,
-7,
-3,
0,
5,
9,
-7,
-3,
-3,
5,
9,
-7,
-7,
-7,
9,
9,
],
[
-7,
9,
9,
9,
9,
-7,
-3,
5,
5,
9,
-7,
-3,
0,
5,
9,
-7,
-3,
-3,
-3,
9,
-7,
-7,
-7,
-7,
-7,
],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ExLaplacian1 ¶
ExLaplacian1(**kwargs: Any)
Bases: SingleMatrix
, Matrix5x5
Extended Pierre-Simon de Laplace operator, 1st implementation.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[
0,
0,
-1,
0,
0,
0,
0,
-1,
0,
0,
-1,
-1,
8,
-1,
-1,
0,
0,
-1,
0,
0,
0,
0,
-1,
0,
0,
]
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ExLaplacian2 ¶
ExLaplacian2(**kwargs: Any)
Bases: SingleMatrix
, Matrix5x5
Extended Pierre-Simon de Laplace operator, 2nd implementation.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[
0,
1,
-1,
1,
0,
1,
1,
-4,
1,
1,
-1,
-4,
8,
-4,
-1,
1,
1,
-4,
1,
1,
0,
1,
-1,
1,
0,
]
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ExLaplacian3 ¶
ExLaplacian3(**kwargs: Any)
Bases: SingleMatrix
, Matrix5x5
Extended Pierre-Simon de Laplace operator, 3rd implementation.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[
-1,
1,
-1,
1,
-1,
1,
2,
-4,
2,
1,
-1,
-4,
8,
-4,
-1,
1,
2,
-4,
2,
1,
-1,
1,
-1,
1,
-1,
]
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ExLaplacian4 ¶
ExLaplacian4(**kwargs: Any)
Bases: SingleMatrix
, Matrix5x5
Extended Pierre-Simon de Laplace operator, 4th implementation.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
24,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
]
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ExPrewitt ¶
ExPrewitt(**kwargs: Any)
Bases: RidgeDetect
, EuclideanDistance
, Matrix5x5
Extended Judith M. S. Prewitt operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[
2,
1,
0,
-1,
-2,
2,
1,
0,
-1,
-2,
2,
1,
0,
-1,
-2,
2,
1,
0,
-1,
-2,
2,
1,
0,
-1,
-2,
],
[
2,
2,
2,
2,
2,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
-1,
-1,
-1,
-1,
-1,
-2,
-2,
-2,
-2,
-2,
],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
ExSobel ¶
ExSobel(**kwargs: Any)
Bases: RidgeDetect
, EuclideanDistance
, Matrix5x5
Extended Sobel-Feldman operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[
2,
1,
0,
-1,
-2,
2,
1,
0,
-1,
-2,
4,
2,
0,
-2,
-4,
2,
1,
0,
-1,
-2,
2,
1,
0,
-1,
-2,
],
[
2,
2,
4,
2,
2,
1,
1,
2,
1,
1,
0,
0,
0,
0,
0,
-1,
-1,
-2,
-1,
-1,
-2,
-2,
-4,
-2,
-2,
],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
FDoG ¶
FDoG(**kwargs: Any)
Bases: RidgeDetect
, EuclideanDistance
, Matrix5x5
Flow-based Difference of Gaussian
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[
1,
1,
0,
-1,
-1,
2,
2,
0,
-2,
-2,
3,
3,
0,
-3,
-3,
2,
2,
0,
-2,
-2,
1,
1,
0,
-1,
-1,
],
[
1,
2,
3,
2,
1,
1,
2,
3,
2,
1,
0,
0,
0,
0,
0,
-1,
-2,
-3,
-2,
-1,
-1,
-2,
-3,
-2,
-1,
],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
FDoGTCanny ¶
FDoGTCanny(**kwargs: Any)
Bases: Matrix5x5
, EdgeDetect
Flow-based Difference of Gaussian TCanny Vapoursynth plugin.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Farid ¶
Farid(**kwargs: Any)
Bases: NormalizeProcessor
, RidgeDetect
, EuclideanDistance
, Matrix5x5
Farid & Simoncelli operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[
0.004127602875174862,
0.027308149775363867,
0.04673225765917656,
0.027308149775363867,
0.004127602875174862,
0.010419993699470744,
0.06893849946536831,
0.11797400212587895,
0.06893849946536831,
0.010419993699470744,
0.0,
0.0,
0.0,
0.0,
0.0,
-0.010419993699470744,
-0.06893849946536831,
-0.11797400212587895,
-0.06893849946536831,
-0.010419993699470744,
-0.004127602875174862,
-0.027308149775363867,
-0.04673225765917656,
-0.027308149775363867,
-0.004127602875174862,
],
[
0.004127602875174862,
0.010419993699470744,
0.0,
-0.010419993699470744,
-0.004127602875174862,
0.027308149775363867,
0.06893849946536831,
0.0,
-0.06893849946536831,
-0.027308149775363867,
0.04673225765917656,
0.11797400212587895,
0.0,
-0.11797400212587895,
-0.04673225765917656,
0.027308149775363867,
0.06893849946536831,
0.0,
-0.06893849946536831,
-0.027308149775363867,
0.004127602875174862,
0.010419993699470744,
0.0,
-0.010419993699470744,
-0.004127602875174862,
],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
FreyChen ¶
FreyChen(**kwargs: Any)
Bases: NormalizeProcessor
, MatrixEdgeDetect
Chen Frei operator. 3x3 matrices properly implemented.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) – -
sqrt2
–
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
divisors class-attribute
¶
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[1, sqrt2, 1, 0, 0, 0, -1, -sqrt2, -1],
[1, 0, -1, sqrt2, 0, -sqrt2, 1, 0, -1],
[0, -1, sqrt2, 1, 0, -1, -sqrt2, 1, 0],
[sqrt2, -1, 0, -1, 0, 1, 0, 1, -sqrt2],
[0, 1, 0, -1, 0, -1, 0, 1, 0],
[-1, 0, 1, 0, 0, 0, 1, 0, -1],
[1, -2, 1, -2, 4, -2, 1, -2, 1],
[-2, 1, -2, 1, 4, 1, -2, 1, -2],
[1, 1, 1, 1, 1, 1, 1, 1, 1],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
FreyChenG41 ¶
FreyChenG41(**kwargs: Any)
Bases: RidgeDetect
, EuclideanDistance
, Matrix3x3
"Chen Frei" operator. 3x3 matrices from G41Fun.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[-7, 0, 7, -10, 0, 10, -7, 0, 7],
[-7, -10, -7, 0, 0, 0, 7, 10, 7],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
Kayyali ¶
Kayyali(**kwargs: Any)
Bases: SingleMatrix
, Matrix3x3
Kayyali operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Kirsch ¶
Kirsch(mag_directions: MagDirection = ALL, **kwargs: Any)
Bases: MagnitudeMatrix
, Max
, Matrix3x3
Russell Kirsch compass operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
mag_directions
– -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
306 307 308 309 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[5, 5, 5, -3, 0, -3, -3, -3, -3],
[5, 5, -3, 5, 0, -3, -3, -3, -3],
[5, -3, -3, 5, 0, -3, 5, -3, -3],
[-3, -3, -3, 5, 0, -3, 5, 5, -3],
[-3, -3, -3, -3, 0, -3, 5, 5, 5],
[-3, -3, -3, -3, 0, 5, -3, 5, 5],
[-3, -3, 5, -3, 0, 5, -3, -3, 5],
[-3, 5, 5, -3, 0, 5, -3, -3, -3],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
KirschTCanny ¶
KirschTCanny(**kwargs: Any)
Bases: Matrix3x3
, EdgeDetect
Russell Kirsch compass TCanny Vapoursynth plugin operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Kroon ¶
Kroon(**kwargs: Any)
Bases: RidgeDetect
, EuclideanDistance
, Matrix3x3
Dirk-Jan Kroon operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[-17, 0, 17, -61, 0, 61, -17, 0, 17],
[-17, -61, -17, 0, 0, 0, 17, 61, 17],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
KroonTCanny ¶
KroonTCanny(**kwargs: Any)
Bases: Matrix3x3
, EdgeDetect
Dirk-Jan Kroon TCanny Vapoursynth plugin operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Laplacian1 ¶
Laplacian1(**kwargs: Any)
Bases: SingleMatrix
, Matrix3x3
Pierre-Simon de Laplace operator 1st implementation.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Laplacian2 ¶
Laplacian2(**kwargs: Any)
Bases: SingleMatrix
, Matrix3x3
Pierre-Simon de Laplace operator 2nd implementation.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Laplacian3 ¶
Laplacian3(**kwargs: Any)
Bases: SingleMatrix
, Matrix3x3
Pierre-Simon de Laplace operator 3rd implementation.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Laplacian4 ¶
Laplacian4(**kwargs: Any)
Bases: SingleMatrix
, Matrix3x3
Pierre-Simon de Laplace operator 4th implementation.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
LoG ¶
LoG(**kwargs: Any)
Bases: SingleMatrix
, Matrix5x5
Laplacian of Gaussian operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[
0,
0,
-1,
0,
0,
0,
-1,
-2,
-1,
0,
-1,
-2,
16,
-2,
-1,
0,
-1,
-2,
-1,
0,
0,
0,
-1,
0,
0,
]
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
MagDirection ¶
Bases: IntFlag
Direction of magnitude calculation.
Methods:
Attributes:
select_matrices ¶
Source code in vsmasktools/edge/_abstract.py
81 82 83 84 85 86 87 |
|
MagnitudeMatrix ¶
MagnitudeMatrix(mag_directions: MagDirection = ALL, **kwargs: Any)
Bases: MatrixEdgeDetect
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
mag_directions
– -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
306 307 308 309 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Matrix1D ¶
Matrix1D(**kwargs: Any)
Bases: EdgeDetect
, ABC
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Matrix3x3 ¶
Matrix3x3(**kwargs: Any)
Bases: EdgeDetect
, ABC
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Matrix5x5 ¶
Matrix5x5(**kwargs: Any)
Bases: EdgeDetect
, ABC
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
MatrixEdgeDetect ¶
MatrixEdgeDetect(**kwargs: Any)
Bases: EdgeDetect
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Max ¶
Max(**kwargs: Any)
Bases: MatrixEdgeDetect
, ABC
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
MinMax ¶
Bases: EdgeDetect
Min/max mask with separate luma/chroma radii.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
Source code in vsmasktools/edge/_3x3.py
392 393 394 395 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Prewitt ¶
Prewitt(**kwargs: Any)
Bases: RidgeDetect
, EuclideanDistance
, Matrix3x3
Judith M. S. Prewitt operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[1, 0, -1, 1, 0, -1, 1, 0, -1],
[1, 1, 1, 0, 0, 0, -1, -1, -1],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
PrewittStd ¶
PrewittStd(**kwargs: Any)
Bases: Matrix3x3
, EdgeDetect
Judith M. S. Prewitt Vapoursynth plugin operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
PrewittTCanny ¶
PrewittTCanny(**kwargs: Any)
Bases: Matrix3x3
, EdgeDetect
Judith M. S. Prewitt TCanny plugin operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
RScharr ¶
RScharr(**kwargs: Any)
Bases: RidgeDetect
, EuclideanDistance
, Matrix3x3
Refined H. Scharr operator to more accurately calculate 1st derivatives for a 3x3 kernel with coeffs 47 and 162.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[-47, 0, 47, -162, 0, 162, -47, 0, 47],
[-47, -162, -47, 0, 0, 0, 47, 162, 47],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
RidgeDetect ¶
RidgeDetect(**kwargs: Any)
Bases: MatrixEdgeDetect
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
Robinson3 ¶
Robinson3(mag_directions: MagDirection = ALL, **kwargs: Any)
Bases: MagnitudeMatrix
, Max
, Matrix3x3
Robinson compass operator level 3.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
mag_directions
– -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
306 307 308 309 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[1, 1, 1, 0, 0, 0, -1, -1, -1],
[1, 1, 0, 1, 0, -1, 0, -1, -1],
[1, 0, -1, 1, 0, -1, 1, 0, -1],
[0, -1, -1, 1, 0, -1, 1, 1, 0],
[],
[],
[],
[],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Robinson5 ¶
Robinson5(mag_directions: MagDirection = ALL, **kwargs: Any)
Bases: MagnitudeMatrix
, Max
, Matrix3x3
Robinson compass operator level 5.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
mag_directions
– -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
306 307 308 309 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[1, 2, 1, 0, 0, 0, -1, -2, -1],
[2, 1, 0, 1, 0, -1, 0, -1, -2],
[1, 0, -1, 2, 0, -2, 1, 0, -1],
[0, -1, -2, 1, 0, -1, 2, 1, 0],
[],
[],
[],
[],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Scharr ¶
Scharr(**kwargs: Any)
Bases: RidgeDetect
, EuclideanDistance
, Matrix3x3
Original H. Scharr optimised operator which attempts to achieve the perfect rotational symmetry with coefficients 3 and 10.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[-3, 0, 3, -10, 0, 10, -3, 0, 3],
[-3, -10, -3, 0, 0, 0, 3, 10, 3],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
ScharrTCanny ¶
ScharrTCanny(**kwargs: Any)
Bases: Matrix3x3
, EdgeDetect
H. Scharr optimised TCanny Vapoursynth plugin operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
SingleMatrix ¶
SingleMatrix(**kwargs: Any)
Bases: MatrixEdgeDetect
, ABC
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Sobel ¶
Sobel(**kwargs: Any)
Bases: RidgeDetect
, EuclideanDistance
, Matrix3x3
Sobel-Feldman operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[1, 0, -1, 2, 0, -2, 1, 0, -1],
[1, 2, 1, 0, 0, 0, -1, -2, -1],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
SobelStd ¶
SobelStd(**kwargs: Any)
Bases: Matrix3x3
, EdgeDetect
Sobel-Feldman Vapoursynth plugin operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
SobelTCanny ¶
SobelTCanny(**kwargs: Any)
Bases: Matrix3x3
, EdgeDetect
Sobel-Feldman Vapoursynth plugin operator.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
TEdge ¶
TEdge(**kwargs: Any)
Bases: EuclideanDistance
, Matrix1D
(TEdgeMasktype=2) Avisynth plugin.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
TEdgeTedgemask ¶
TEdgeTedgemask(**kwargs: Any)
Bases: Matrix1D
, EdgeDetect
(tedgemask.TEdgeMask(threshold=0.0, type=2)) Vapoursynth plugin.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
TheToof ¶
TheToof(mag_directions: MagDirection = ALL, **kwargs: Any)
Bases: MagnitudeMatrix
, Max
, Matrix3x3
TheToof compass operator from SharpAAMCmod.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
mag_directions
– -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
306 307 308 309 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[5, 10, 5, 0, 0, 0, -5, -10, -5],
[10, 5, 0, 5, 0, -5, 0, -5, -10],
[5, 0, -5, 10, 0, -10, 5, 0, -5],
[0, -5, -10, 5, 0, -5, 10, 5, 0],
[],
[],
[],
[],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
Tritical ¶
Tritical(**kwargs: Any)
Bases: RidgeDetect
, EuclideanDistance
, Matrix3x3
Operator used in Tritical's original TCanny filter. Plain and simple orthogonal first order derivative.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
– -
ridgemask
–Makes ridge mask based on convolution kernel.
Attributes:
-
divisors
(Sequence[float] | None
) – -
kwargs
(KwargsT | None
) – -
matrices
(Sequence[Sequence[float]]
) – -
mode_types
(Sequence[str] | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
matrices class-attribute
¶
matrices: Sequence[Sequence[float]] = [
[0, 0, 0, -1, 0, 1, 0, 0, 0],
[0, 1, 0, 0, 0, 0, 0, -1, 0],
]
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
ridgemask ¶
ridgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> VideoNode
Makes ridge mask based on convolution kernel.
The resulting mask can be thresholded with lthr, hthr and multiplied with multi. Using a 32-bit float clip is recommended.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –clamp: Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
VideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
TriticalTCanny ¶
TriticalTCanny(**kwargs: Any)
Bases: Matrix3x3
, EdgeDetect
Operator used in Tritical's original TCanny filter. Plain and simple orthogonal first order derivative.
Methods:
-
depth_scale
– -
edgemask
–Makes edge mask based on convolution kernel.
-
ensure_obj
– -
from_param
–
Attributes:
-
kwargs
(KwargsT | None
) –
Source code in vsmasktools/edge/_abstract.py
140 141 142 143 |
|
depth_scale classmethod
¶
depth_scale(
clip: VideoNode, bitdepth: VideoFormatLike | HoldsVideoFormat | int
) -> ConstantFormatVideoNode
Source code in vsmasktools/edge/_abstract.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
edgemask ¶
edgemask(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> ConstantFormatVideoNode
Makes edge mask based on convolution kernel. The resulting mask can be thresholded with lthr, hthr and multiplied with multi.
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) –Low threshold. Anything below lthr will be set to 0
-
hthr
¶float | None
, default:None
) –High threshold. Anything above hthr will be set to the range max
-
multi
¶float
, default:1.0
) –Multiply all pixels by this before thresholding
-
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
ConstantFormatVideoNode
–Mask clip
Source code in vsmasktools/edge/_abstract.py
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 175 176 177 178 179 180 |
|
ensure_obj classmethod
¶
ensure_obj(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> Self
Source code in vsmasktools/edge/_abstract.py
205 206 207 |
|
from_param classmethod
¶
from_param(
value: type[Self] | Self | str | None = None,
/,
func_except: FuncExcept | None = None,
) -> type[Self]
Source code in vsmasktools/edge/_abstract.py
199 200 201 202 203 |
|
get_all_edge_detects ¶
get_all_edge_detects(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> list[ConstantFormatVideoNode]
Returns all the EdgeDetect subclasses
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) – -
hthr
¶float | None
, default:None
) – -
multi
¶float
, default:1.0
) – -
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
list[ConstantFormatVideoNode]
–A list of edge masks
Source code in vsmasktools/edge/_abstract.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 |
|
get_all_ridge_detect ¶
get_all_ridge_detect(
clip: VideoNode,
lthr: float = 0.0,
hthr: float | None = None,
multi: float = 1.0,
clamp: bool | tuple[float, float] | list[tuple[float, float]] = False,
planes: Planes = None,
**kwargs: Any
) -> list[ConstantFormatVideoNode]
Returns all the RidgeDetect subclasses
Parameters:
-
clip
¶VideoNode
) –Source clip
-
lthr
¶float
, default:0.0
) – -
hthr
¶float | None
, default:None
) – -
multi
¶float
, default:1.0
) – -
clamp
¶bool | tuple[float, float] | list[tuple[float, float]]
, default:False
) –Clamp to legal values if True or specified range
(low, high)
-
planes
¶Planes
, default:None
) –Which planes to process.
Returns:
-
list[ConstantFormatVideoNode]
–A list edge masks
Source code in vsmasktools/edge/_abstract.py
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 |
|