class
Perspective
extends
_WarpTransformPerspective(scale: float | tuple[float, float] = (0.05, 0.1), interpolation: int | str | Interpolation = 1, border_mode: int = 4, value: float = 0.0, p: float = 0.5)Random four-point perspective warp (Albumentations Perspective).
Parameters
scalefloat or (float, float)= (0.05, 0.1)Std (as a fraction of size) of the random corner displacement.
As in
Rotate. keep_size is implicit (output keeps
the input size).As in
Rotate. keep_size is implicit (output keeps
the input size).As in
Rotate. keep_size is implicit (output keeps
the input size).As in
Rotate. keep_size is implicit (output keeps
the input size).Used by 1
Constructors
1Instance methods
1Sample per-call random parameters for Perspective.
Parameters
imgTensorImage tensor; its spatial size is read to scale the
per-corner displacement and to set
out_hw.Returns
WarpParamsCarries the (3, 3) homography mapping the perturbed
corners back to the canvas and out_hw equal to the
input (H, W).