1from __future__
import annotations
3from ids_peak_common.datatypes.interval
import Interval
11 Adjusts the saturation of an image by modifying a 3x3 color correction matrix.
13 @supportedPixelformats{ColorMatrixTransformation}
15 This feature modifies the image's color saturation by scaling the chrominance components
16 of the color correction matrix. A higher saturation makes colors more vivid, while a lower
17 value results in more muted tones.
19 The default value for saturation is 1.0.
21 @since ids_peak_icv 1.0
22 @ingroup ids_peak_icv_python_pipeline_features
25 def __init__(self, module: ColorMatrixTransformationModule) ->
None:
28 Creates a SaturationFeature for an existing color matrix transformation module.
30 @param module: Reference to the underlying module
32 @since ids_peak_icv 1.0
40 Gets whether this feature is currently enabled.
42 @return True if enabled; otherwise False.
44 @since ids_peak_icv 1.0
46 return self.
_module.saturation_enabled
52 Enables or disables the feature.
54 @param enabled: True to enable, False to disable.
56 @since ids_peak_icv 1.0
58 self.
_module.saturation_enabled = enabled
63 Resets the saturation to its default value (1.0).
65 @note The enabled state does not change when calling this function.
67 @since ids_peak_icv 1.0
75 Gets the current saturation value.
77 @return The current saturation value.
79 @since ids_peak_icv 1.0
84 def value(self, saturation: float) ->
None:
87 Sets the saturation value.
89 @param saturation: A floating-point value representing the saturation value.
90 A value of 1.0 means no change, values greater than 1.0 increase saturation,
91 and values less than 1.0 decrease saturation.
92 Valid values are within the range returned by range property.
94 :raise OutOfRangeException: If saturation is outside the valid range.
96 @since ids_peak_icv 1.0
98 self.
_module.saturation = saturation
104 Gets the valid range for the saturation.
106 The returned interval specifies the minimum and maximum values that can be passed to value property.
108 @return An Interval representing the valid saturation range.
110 @since ids_peak_icv 1.0
112 return self.
_module.saturation_range
Abstract base class for all image processing pipeline features.
Adjusts the saturation of an image by modifying a 3x3 color correction matrix.
None reset_to_default(self)
Resets the saturation to its default value (1.0).
float value(self)
Gets the current saturation value.
None __init__(self, ColorMatrixTransformationModule module)
Creates a SaturationFeature for an existing color matrix transformation module.
bool enabled(self)
Gets whether this feature is currently enabled.
Interval range(self)
Gets the valid range for the saturation.