Combine#
- class deeptrack.features.Combine(features: List[Feature], **kwargs: Dict[str, Any])#
Bases:
StructuralFeature
Combine multiple features into a single feature.
This feature sequentially resolves a list of features and returns their results as a list. Each feature in the features parameter operates on the same input, and their outputs are aggregated into a single list.
Parameters#
- featuresList[Feature]
A list of features to combine. Each feature will be resolved in the order they appear in the list.
- **kwargsDict[str, Any], optional
Additional keyword arguments passed to the parent StructuralFeature class.
Methods#
- get(image_list, **kwargs)
Resolves each feature in the features list on the input image and returns their results as a list.
Example#
The result is a list containing the outputs of the GaussianBlur and Add features applied to the input image.
>>> import numpy as np >>> from deeptrack.features import Combine, GaussianBlur, Add
Define a list of features to combine: >>> blur_feature = GaussianBlur(sigma=2) >>> add_feature = Add(value=10)
Combine the features: >>> combined_feature = Combine([blur_feature, add_feature])
Define an input image: >>> input_image = np.ones((10, 10))
Apply the combined feature: >>> output_list = combined_feature(input_image)
Methods Summary
get
(image_list, **kwargs)Resolve each feature in the features list on the input image.
Methods Documentation
- get(image_list: Any, **kwargs: Dict[str, Any]) List[Any] #
Resolve each feature in the features list on the input image.
Parameters#
- image_listAny
The input image or list of images to process.
- **kwargsDict[str, Any]
Additional arguments passed to each feature’s resolve method.
Returns#
- List[Any]
A list containing the outputs of each feature applied to the input.