class
OpticalDistortion
extends
_DisplacementTransformOpticalDistortion(distort_limit: float | tuple[float, float] = 0.05, shift_limit: float | tuple[float, float] = 0.05, interpolation: int | str | Interpolation = 1, p: float = 0.5)Radial (barrel / pincushion) distortion (Albumentations OpticalDistortion).
Parameters
distort_limitfloat or (float, float)= 0.05Radial coefficient range.
shift_limitfloat or (float, float)= 0.05Optical-center shift range (fraction of size).
No description.
pfloat= 0.5No description.
Used by 1
Constructors
1Instance methods
1Sample per-call random parameters for OpticalDistortion.
Parameters
imgTensorImage tensor; its spatial size sets the displacement
field size, the centred normalisation, and
out_hw.Returns
DispParamsCarries per-pixel dx / dy fields of shape
(H, W) realising the radial backward map
sample(p) = c + (p - c) * (1 + k * r^2) with k
drawn uniformly from distort_limit and the optical
centre c shifted from the image centre by
shift_limit fractions. out_hw equals the input
(H, W).