IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
saturation_feature.py
Go to the documentation of this file.
1from __future__ import annotations
2
3from ids_peak_common.datatypes.interval import Interval
4from ids_peak_icv.pipeline._internal.color_matrix_transformation_module import ColorMatrixTransformationModule
6
7
9 """!
10 @brief
11 Adjusts the saturation of an image by modifying a 3x3 color correction matrix.
12
13 @supportedPixelformats{ColorMatrixTransformation}
14
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.
18
19 The default value for saturation is 1.0.
20
21 @since ids_peak_icv 1.0
22 @ingroup ids_peak_icv_python_pipeline_features
23 """
24
25 def __init__(self, module: ColorMatrixTransformationModule) -> None:
26 """!
27 @brief
28 Creates a SaturationFeature for an existing color matrix transformation module.
29
30 @param module: Reference to the underlying module
31
32 @since ids_peak_icv 1.0
33 """
34 self._module = module
35
36 @property
37 def enabled(self) -> bool:
38 """!
39 @brief
40 Gets whether this feature is currently enabled.
41
42 @return True if enabled; otherwise False.
43
44 @since ids_peak_icv 1.0
45 """
46 return self._module.saturation_enabled
47
48 @enabled.setter
49 def enabled(self, enabled: bool) -> None:
50 """!
51 @brief
52 Enables or disables the feature.
53
54 @param enabled: True to enable, False to disable.
55
56 @since ids_peak_icv 1.0
57 """
58 self._module.saturation_enabled = enabled
59
60 def reset_to_default(self) -> None:
61 """!
62 @brief
63 Resets the saturation to its default value (1.0).
64
65 @note The enabled state does not change when calling this function.
66
67 @since ids_peak_icv 1.0
68 """
70
71 @property
72 def value(self) -> float:
73 """!
74 @brief
75 Gets the current saturation value.
76
77 @return The current saturation value.
78
79 @since ids_peak_icv 1.0
80 """
81 return self._module.saturation
82
83 @value.setter
84 def value(self, saturation: float) -> None:
85 """!
86 @brief
87 Sets the saturation value.
88
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.
93
94 :raise OutOfRangeException: If saturation is outside the valid range.
95
96 @since ids_peak_icv 1.0
97 """
98 self._module.saturation = saturation
99
100 @property
101 def range(self) -> Interval:
102 """!
103 @brief
104 Gets the valid range for the saturation.
105
106 The returned interval specifies the minimum and maximum values that can be passed to value property.
107
108 @return An Interval representing the valid saturation range.
109
110 @since ids_peak_icv 1.0
111 """
112 return self._module.saturation_range
Abstract base class for all image processing pipeline features.
Definition ifeature.py:6
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).
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.