IDS peak ICV v1.2.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 @param module: Reference to the underlying module
30
31 @since ids_peak_icv 1.0
32 """
33 self._module = module
34
35 @property
36 def enabled(self) -> bool:
37 """!
38 @brief
39 Indicates whether the feature is currently enabled.
40 @return True if enabled; otherwise, False.
41
42 @since ids_peak_icv 1.0
43 """
44 return self._module.saturation_enabled
45
46 @enabled.setter
47 def enabled(self, value: bool) -> None:
48 """!
49 @brief
50 Enables or disables the feature.
51 @param value: Set to True to enable the feature, or False to disable it.
52
53 @since ids_peak_icv 1.0
54 """
55 self._module.saturation_enabled = value
56
57 def reset_to_default(self) -> None:
58 """!
59 @brief
60 Resets the saturation value to 1.0.
61
62 @note The enabled state does not change when calling this function.
63
64 @since ids_peak_icv 1.0
65 """
67
68 @property
69 def value(self) -> float:
70 """!
71 @brief
72 Gets the current saturation value.
73 @return The saturation value currently set.
74
75 @since ids_peak_icv 1.0
76 """
77 return self._module.saturation
78
79 @value.setter
80 def value(self, saturation: float) -> None:
81 """!
82 @brief
83 Sets the saturation value.
84
85 @param saturation: A floating-point value representing the saturation value.
86 Valid values are within the range returned by range property.
87
88 :raise OutOfRangeException: If saturation is outside the valid range.
89
90 @since ids_peak_icv 1.0
91 """
92 self._module.saturation = saturation
93
94 @property
95 def range(self) -> Interval:
96 """!
97 @brief
98 Retrieves the valid range for the saturation.
99
100 The returned interval specifies the minimum and maximum values that can be passed to value property.
101
102 @return An Interval representing the valid saturation range.
103
104 @since ids_peak_icv 1.0
105 """
106 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 value to 1.0.
None __init__(self, ColorMatrixTransformationModule module)
Creates a SaturationFeature for an existing color matrix transformation module.
bool enabled(self)
Indicates whether the feature is currently enabled.
Interval range(self)
Retrieves the valid range for the saturation.