ElementwiseFeature#
- class deeptrack.elementwise.ElementwiseFeature(function: Callable[[np.ndarray], np.ndarray], feature: Feature | None = None, **kwargs: Any)#
Bases:
FeatureBase class for applying NumPy functions elementwise.
This class provides the foundation for subclasses that apply specific NumPy functions (e.g., sin, cos, exp) to the elements of an input array.
Parameters#
- functionCallable[[np.ndarray], np.ndarray]
The NumPy function to be applied elementwise.
- featureFeature or None, optional
The input feature to which the function will be applied. If None, the function will be applied to the input array directly.
Methods#
- get(image: np.ndarray, **kwargs: Any) -> np.ndarray
Returns the result of applying the function to the input array.
Methods Summary
get(image, **kwargs)Transform an image [abstract method].
Methods Documentation
- get(image: ndarray, **kwargs: Any) ndarray#
Transform an image [abstract method].
Abstract method that defines how the feature transforms the input. The current value of all properties will be passed as keyword arguments.
Parameters#
- image: np.ndarray or list of np.ndarray or Image or list of Images
The image or list of images to transform.
- **kwargs: dict of str to Any
The current value of all properties in properties, as well as any global arguments passed to the feature.
Returns#
- Image or list of Images
The transformed image or list of images.
Raises#
- NotImplementedError
Raised if this method is not overridden by subclasses.