class
ElasticTransform
extends
_DisplacementTransformElasticTransform(alpha: float = 1.0, sigma: float = 50.0, interpolation: int | str | Interpolation = 1, p: float = 0.5)Elastic deformation (Simard 2003; Albumentations ElasticTransform).
Random fields smoothed by a Gaussian then scaled by alpha.
Parameters
alphafloat= 1.0Displacement magnitude.
sigmafloat= 50.0Gaussian smoothing of the displacement field (pixels).
No description.
pfloat= 0.5No description.
Used by 1
Constructors
1Instance methods
1Sample per-call random parameters for ElasticTransform.
Parameters
imgTensorImage tensor; its spatial size sets the displacement
field size and the output canvas.
Returns
DispParamsCarries per-pixel dx / dy displacement fields of
shape (H, W) in pixel units, built by sampling two
uniform (1, 1, H, W) random fields in [-1, 1],
blurring each with a Gaussian of sigma, and scaling by
alpha — the Simard 2003 recipe. out_hw equals
the input (H, W).