ComplexGaussian#

class deeptrack.optical.noises.ComplexGaussian(mu: float | Callable[[...], float] = 0, sigma: float | Callable[[...], float] = 1, **kwargs: Any)#

Bases: Noise

Add complex-valued IID Gaussian noise to an image.

Complex Gaussian noise is generated by sampling two independent Gaussian distributions for the real and imaginary components and combining them into a complex-valued noise field that is added pixel-wise to the input image.

Parameters#

mu: PropertyLike[float], optional

Mean of the Gaussian distribution. Deafults to 0.

sigma: PropertyLike[float], optional

Standard deviation of the Gaussian distribution. Defaults to 1.

Methods#

get(image, mu, sigma, **kwargs) -> np.ndarray | torch.Tensor

Returns the input image with complex Gaussian noise added.

Examples#

Add complex Gaussian noise to an image.

>>> import deeptrack as dt
>>> import numpy as np

Create an input image:

>>> image = np.ones((2, 2)) * 3

Define complex Gaussian noise:

>>> noise = dt.ComplexGaussian(mu=1, sigma=0.1)

Apply the noise:

>>> noisy = noise(image)
>>> print(noisy)
[[3.79975648-0.06967551j 4.09943404+0.06499738j]
 [3.99886747-0.23549974j 4.15725117-0.07847024j]]

Methods Summary

get(image, mu, sigma, **kwargs)

Add complex Gaussian noise to the input image.

Methods Documentation

get(image: ndarray | Tensor, mu: float, sigma: float, **kwargs: Any) ndarray | Tensor#

Add complex Gaussian noise to the input image.

Parameters#

image: np.ndarray | torch.Tensor

Input image to which noise will be added.

mu: float

Mean of the Gaussian distribution.

sigma: float

Standard deviation of the Gaussian distribution.

**kwargs: Any

Additional keyword arguments passed through the feature pipeline.

Returns#

np.ndarray | torch.Tensor

The input image with complex Gaussian noise added.