PepperNoisePerturber#
- class nrtk.impls.perturb_image.photometric.noise.PepperNoisePerturber(*, seed: int | None = None, is_static: bool = False, amount: float = 0.05, clip: bool = True)#
Adds pepper noise to image stimulus.
- Attributes:
- seed (int | None):
Random seed for reproducible results. None means non-deterministic.
- is_static (bool):
If True and seed is set, resets RNG state after each perturb call.
- clip (bool):
Decide if output is clipped between the range of [-1, 1].
- amount (float):
Proportion of image pixels to replace with pepper noise on range [0, 1]
Methods
from_configInstantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
get_configReturns the current configuration of the _SPNoisePerturber instance.
get_default_configGenerate and return a default configuration dictionary for this class.
get_implsDiscover plugins, skipping any entrypoints that fail to load.
get_type_stringReturns the fully qualified type string of the PerturbImage class or its subclass.
is_usableCheck whether this class is available for use.
Return image stimulus with pepper noise.
- perturb(*, image: ndarray[Any, Any], boxes: Iterable[tuple[AxisAlignedBoundingBox, dict[Hashable, float]]] | None = None, **kwargs: Any) tuple[ndarray[Any, Any], Iterable[tuple[AxisAlignedBoundingBox, dict[Hashable, float]]] | None]#
Return image stimulus with pepper noise.