Background#
- class deeptrack.optical.noises.Background(offset: float | Callable[[...], float], **kwargs: Any)#
Bases:
NoiseAdd a constant value to an image.
Parameters#
- offset: PropertyLike[float]
Constant value added to the image.
- **kwargs: Any
Additional keyword arguments passed to the parent Noise class.
Methods#
- get(image, offset, **kwargs) -> np.ndarray | torch.Tensor
Adds the constant offset to the input image.
Examples#
>>> import deeptrack as dt >>> import numpy as np
Create an input image with zeros
>>> image = np.zeros((2, 2))
Define a background offset:
>>> noise = dt.Background(offset=0.5)
Apply the noise
>>> noisy = noise(image) >>> print(noisy) [[0.5 0.5] [0.5 0.5]]
Methods Summary
get(image, offset, **kwargs)Add the given offset to the image.
Methods Documentation