deeptrack.optical.noises Module#
Noise models for images and array-like data.
This module provides features that add different types of noise to images, arrays, and scattered objects. The implemented noise models include constant offsets, Gaussian noise, complex Gaussian noise, and Poisson-distributed noise. These features are typically used to simulate detector noise, background signals, or stochastic measurement processes in synthetic microscopy pipelines. All noise models operate on both NumPy arrays and PyTorch tensors. The active DeepTrack backend determines which implementation is used.
Module Structure#
Classes:
Noise: Base class for noise models.
Background / Offset: Adds a constant value to the input image.
Gaussian: Adds IID Gaussian noise.
ComplexGaussian: Adds complex-valued Gaussian noise.
Poisson: Adds Poisson-distributed noise based on signal-to-noise ratio.
Examples#
>>> import deeptrack as dt
Add Gaussian noise to an image.
>>> particle = dt.PointParticle(intensity=1)
>>> optics = dt.Fluorescence()
>>> gaussian_noise = dt.Gaussian(mu=0, sigma=0.1)
>>> noisy_image = optics(particle) >> gaussian_noise
>>> noisy_image.plot();
Add Poisson noise with a specified signal-to-noise ratio.
>>> poisson_noise = noises.Poisson(snr=0.1)
>>> noisy_image = optics(particle) >> poisson_noise
>>> noisy_image.plot();
Classes#
|
Base class for noise models. |
|
Add a constant value to an image. |
alias of |
|
|
Add IID Gaussian noise to an image. |
|
Add complex-valued IID Gaussian noise to an image. |
|
Add Poisson-distributed noise to an image. |