Rescale#
- class deeptrack.holography.Rescale(rescale=1, **kwargs)#
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: Image | np.ndarray, rescale: float, **kwargs: dict[str, Any]) -> Image | 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: Image | np.ndarray, rescale: float, **kwargs: dict[str, Any]) Image | np.ndarray#
Rescales the image by subtracting the real part of the field before multiplication.
Parameters#
- image: Image or ndarray
The image to rescale.
- rescale: float
The rescaling factor.
- **kwargs: dict of str to Any
Additional keyword arguments.
Returns#
- Image or ndarray
The rescaled image.