Rescale#
- class deeptrack.optical.holography.Rescale(rescale: float = 1, **kwargs: Any)#
Bases:
FeatureRescales an optical field by modifying its real and imaginary components.
- The transformation is applied as:
The real part is shifted and scaled: (real - 1) * rescale + 1
The imaginary part is scaled by rescale
Parameters#
- rescale: float
The scaling factor applied to both real and imaginary components.
Methods#
- get(image, rescale, **kwargs) -> np.ndarray
Rescales the image while preserving phase information.
Examples#
>>> import deeptrack as dt >>> import numpy as np >>> field = np.random.rand(128, 128, 2) >>> rescaled_field = dt.holography.Rescale(0.5)(field)
Methods Summary
get(image, rescale, **kwargs)Rescales the image by subtracting the real part of the field before multiplication.
Methods Documentation
- get(image: ndarray, rescale: float, **kwargs: Any) ndarray#
Rescales the image by subtracting the real part of the field before multiplication.
Parameters#
- image: np.ndarray
The image to rescale.
- rescale: float
The rescaling factor.
- **kwargs: Any
Additional keyword arguments.
Returns#
- np.ndarray
The rescaled image.