nrtk.impls.perturb_image.generic.radial_distortion_perturber

Defines the RadialDistortionPerturber which applies radial distortion to input images.

The Radial distortion perturbation simulates lens distortion effects, such as barrel or pincushion distortion, and is useful for augmenting datasets to improve robustness to camera nonlinearities.

The distortion uses the following equations:

x1 = x0 * (1 + k1*r^2 + k2*r^4 + k3*r^6) y1 = y0 * (1 + k1*r^2 + k2*r^4 + k3*r^6)

Where r is the distance from the image center and k1-k3 are distortion coefficients.

The class also adjusts associated axis-aligned bounding boxes to match the distorted image, making it suitable for tasks involving labeled datasets.

Classes:

RadialDistortionPerturber: A perturbation class for applying random radial distortion to images and updating their corresponding bounding boxes.

Dependencies:
  • numpy: For numerical operations and array manipulation.

  • smqtk_image_io.AxisAlignedBoundingBox: For handling and adjusting bounding boxes.

  • nrtk.interfaces.perturb_image.PerturbImage: Base class for image perturbation algorithms.

Classes

RadialDistortionPerturber

RadialDistortionPerturber applies a radial distortion to an image.