Combine#
- class deeptrack.features.Combine(features: list[Feature], **kwargs: dict[str, Any])#
Bases:
StructuralFeatureCombine 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#
- features: list of Features
A list of features to combine. Each feature will be resolved in the order they appear in the list.
- **kwargs: dict of str to Any, optional
Additional keyword arguments passed to the parent StructuralFeature class.
Methods#
- get(image_list: Any, **kwargs: dict[str, Any]) -> list[Any]
Resolves each feature in the features list on the input image and returns their results as a list.
Examples#
>>> import deeptrack as dt >>> import numpy as np
Define a list of features to combine GaussianBlur and Add: >>> blur_feature = dt.GaussianBlur(sigma=2) >>> add_feature = dt.Add(value=10)
Combine the features: >>> combined_feature = dt.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_list: Any
The input image or list of images to process.
- **kwargs: dict of str to 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.