JitterPerturber#

class nrtk.impls.perturb_image.optical.otf.JitterPerturber(*, s_x: float | None = None, s_y: float | None = None, interp: bool = True, **kwargs: Any)#

Implements image perturbation using jitter and Optical Transfer Function (OTF).

This class applies realistic perturbations to images based on sensor and scenario configurations, leveraging Optical Transfer Function (OTF) modeling through the pyBSM library. Perturbations include jitter effects that simulate real-world distortions in optical imaging systems.

See https://pybsm.readthedocs.io/en/latest/explanation.html for image formation concepts and parameter details.

Methods

from_config

Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.

get_config

Get current configuration including perturber-specific parameters.

get_default_config

Generate and return a default configuration dictionary for this class.

get_impls

Discover plugins, skipping any entrypoints that fail to load.

get_type_string

Returns the fully qualified type string of the PerturbImage class or its subclass.

is_usable

Check whether this class is available for use.

perturb

Apply the OTF-based perturbation to the provided image.

__init__(*, s_x: float | None = None, s_y: float | None = None, interp: bool = True, **kwargs: Any) None#

Initializes the JitterPerturber.

Args:
s_x:

root-mean-squared jitter amplitudes in the x direction (rad).

s_y:

root-mean-squared jitter amplitudes in the y direction (rad).

interp:

a boolean determining whether load_database_atmosphere is used with or without interpolation.

kwargs:

sensor and/or scenario values to modify

If both sensor and scenario parameters are not present, then default values will be used for their parameters

If neither s_x, s_y, sensor or scenario parameters are provided, the values of s_x and s_y will be the default of 0.0 as that results in a nadir view.

If sensor and scenario parameters are provided, but not s_x and s_y, the values of s_x and s_y will come from the sensor and scenario objects.

If s_x and s_y are ever provided by the user, those values will be used in the otf calculation.

get_config() dict[str, Any]#

Get current configuration including perturber-specific parameters.