class
Defocus
extends
PhotometricTransform[RadiusParam]Defocus(radius: tuple[int, int] = (3, 10), p: float = 0.5)Disk-kernel (out-of-focus) blur (Albumentations Defocus).
Samples an integer radius r from radius (inclusive) and
convolves with a normalised disk of radius r — pixels inside
the disk get weight 1 / area, those outside get zero.
Approximates the bokeh circle of an out-of-focus lens better than
Gaussian blur.
Parameters
radius(int, int)= (3, 10)Inclusive sampling range for the disk radius in pixels.
Larger radii produce more aggressive defocus.
pfloat= 0.5Probability of applying the transform.
Used by 1
Constructors
1Instance methods
1Sample per-call random parameters for Defocus.
Parameters
imgTensorImage tensor; not inspected, carried through for dispatch.
Returns
RadiusParamCarries radius — the disk-kernel radius in pixels
drawn uniformly from the constructor's radius range.