IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
sharpening_feature.py
Go to the documentation of this file.
1from __future__ import annotations
2
3from ids_peak_common.datatypes.interval import Interval
6
7
9 """!
10 @brief
11 Provides access to sharpening settings within an image processing pipeline.
12
13 @supportedPixelformats{Sharpening}
14
15 This feature emphasizes edges and fine structures by increasing contrast between adjacent pixels.
16 The strength of the sharpening effect is controlled by the `value` property, where a value of 0
17 applies no sharpening. Higher values increase the sharpening effect.
18
19 Warning:
20 Increasing the sharpness level can also amplify image noise and introduce visual artifacts
21 such as halos around edges. Moderate values are recommended for optimal results.
22
23 The default level for sharpening is 0.
24
25 @since ids_peak_icv 1.0
26 @ingroup ids_peak_icv_python_pipeline_features
27 """
28
29 def __init__(self, module: SharpeningModule) -> None:
30 """!
31 @brief
32 Initialize the SharpeningFeature to manage the specified sharpening module.
33
34 @param module: Reference to the underlying SharpeningModule
35
36 @since ids_peak_icv 1.0
37 """
38 self._module = module
39
40 @property
41 def enabled(self) -> bool:
42 """!
43 @brief
44 Gets whether this feature is currently enabled.
45
46 @return True if enabled; otherwise False.
47
48 @since ids_peak_icv 1.0
49 """
50 return self._module.enabled
51
52 @enabled.setter
53 def enabled(self, enabled: bool) -> None:
54 """!
55 @brief
56 Enables or disables the feature.
57
58 @param enabled: True to enable, False to disable.
59
60 @since ids_peak_icv 1.0
61 """
62 self._module.enabled = enabled
63
64 def reset_to_default(self) -> None:
65 """!
66 @brief
67 Resets the sharpness level to its default value (0).
68
69 @note The enabled state is not changed when calling this function.
70
71 @since ids_peak_icv 1.0
72 """
74
75 @property
76 def level(self) -> int:
77 """!
78 @brief
79 Gets the current sharpness level.
80
81 @return The current sharpening level.
82
83 @since ids_peak_icv 1.0
84 """
85 return self._module.level
86
87 @level.setter
88 def level(self, level: int) -> None:
89 """!
90 @brief
91 Sets the sharpness level.
92
93 @param level: An integer representing the desired sharpness level.
94 The acceptable range of values can be obtained from the range property.
95
96 @exception OutOfRangeException: If the level is outside the valid range.
97
98 @since ids_peak_icv 1.0
99 """
100 self._module.level = level
101
102 @property
103 def range(self) -> Interval:
104 """!
105 @brief
106 Retrieves the valid range of sharpness levels.
107
108 @return An Interval object containing minimum and maximum allowed values.
109
110 @since ids_peak_icv 1.0
111 """
112 return self._module.level_range
Abstract base class for all image processing pipeline features.
Definition ifeature.py:6
Provides access to sharpening settings within an image processing pipeline.
None reset_to_default(self)
Resets the sharpness level to its default value (0).
None __init__(self, SharpeningModule module)
Initialize the SharpeningFeature to manage the specified sharpening module.
bool enabled(self)
Gets whether this feature is currently enabled.
Interval range(self)
Retrieves the valid range of sharpness levels.