diff --git a/elevation_mapping_cupy/script/elevation_mapping_cupy/plugins/max_layer_filter.py b/elevation_mapping_cupy/script/elevation_mapping_cupy/plugins/max_layer_filter.py index 1c4e7853..34783ebd 100644 --- a/elevation_mapping_cupy/script/elevation_mapping_cupy/plugins/max_layer_filter.py +++ b/elevation_mapping_cupy/script/elevation_mapping_cupy/plugins/max_layer_filter.py @@ -29,6 +29,7 @@ def __init__( reverse: list = [True], min_or_max: str = "max", thresholds: list = [False], + scales: list = [1.0], default_value: float = 0.0, **kwargs, ): @@ -37,6 +38,7 @@ def __init__( self.reverse = reverse self.min_or_max = min_or_max self.thresholds = thresholds + self.scales = scales self.default_value = default_value def __call__( @@ -84,6 +86,8 @@ def __call__( layer = cp.where(layer == 0, default_layer, layer) if self.reverse[it]: layer = 1.0 - layer + if len(self.scales) > it and isinstance(self.scales[it], float): + layer = layer * float(self.scales[it]) if isinstance(self.thresholds[it], float): layer = cp.where(layer > float(self.thresholds[it]), 1, 0) layers.append(layer)