GaussNoise
Add Gaussian (normal) noise to the image. i.i.d. per pixel (or per block if scaled). Use for robustness to sensor or transmission noise.
Noise standard deviation and mean are sampled from configurable ranges and scaled to image dtype (255 for uint8, 1.0 for float32). Optional per-channel sampling and lower-resolution noise for speed.
std_rangeRange for noise standard deviation as a fraction of the max value (255 for uint8, 1.0 for float32). In [0, 1]. Default: (0.2, 0.44).
mean_rangeRange for noise mean as a fraction of max. In [-1, 1]. Default: (0.0, 0.0).
per_channelIf True, sample noise per channel; else same noise for all. Default: False.
noise_scale_factorIf < 1, noise is generated at lower resolution and resized (faster, coarser). 1 = per-pixel. In (0, 1]. Default: 1.0.
pProbability of applying the transform. Default: 0.5.
>>> import numpy as np
>>> import albumentations as A
>>> image = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
>>>
>>> transform = A.GaussNoise(std_range=(0.1, 0.2), p=1.0)
>>> noisy_image = transform(image=image)["image"]- std_range and mean_range are in [0, 1] / [-1, 1]; scaled by 255 (uint8) or used directly (float32).
- per_channel=False: faster, same noise on all channels (grayscale-like on RGB).
- per_channel=True: different noise per channel (colored noise).
- noise_scale_factor < 1 trades speed for noise granularity.
- FilmGrain: Luminance-dependent, spatially correlated (film-like) noise.
- ShotNoise: Poisson noise in linear space; sensor-realistic for low light.