IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
decimation_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 Decimation is used to decrease the image size.
12
13 @supportedPixelformats{Downsampling}
14
15 This method reduces resolution by selecting (i.e., skipping) pixels at regular intervals
16 along columns (x), rows (y) or both.
17 It is computationally efficient but may introduce aliasing.
18
19 @note Processes the entire image, ignoring any specified image region.
20 @note As with binning, the alpha channel of the input image (if present) is also ignored during decimation.
21 It is always set to the maximum possible pixel value.
22 @note Decimation permanently reduces image resolution. The original resolution cannot be recovered
23 after decimation is applied.
24
25 Default Configuration:
26 - x = 1
27 - y = 1
28 - DownsamplingMode.Decimation
29
30 @since ids_peak_icv 1.0
31 @ingroup ids_peak_icv_python_pipeline_features
32 """
33
34 def __init__(self, module: DownsamplingModule) -> None:
35 """!
36 @brief
37 Creates a DecimationFeature for an existing downsampling module.
38
39 @param module: module Reference to the underlying DownsamplingModule.
40 """
41
42 self._module = module
43
44 @property
45 def enabled(self) -> bool:
46 """!
47 @brief
48 Gets whether this feature is currently enabled.
49
50 @return True if enabled; otherwise False.
51 """
52 return self._module.enabled
53
54 @enabled.setter
55 def enabled(self, enabled: bool) -> None:
56 """!
57 @brief
58 Enables or disables the feature.
59
60 @param enabled: True to enable, False to disable.
61 """
62 self._module.enabled = enabled
63
64 def reset_to_default(self) -> None:
65 """!
66 @brief
67 Resets all settings to their defaults.
68
69 Default configuration:
70 - x = 1
71 - y = 1
72 - mode = DownsamplingMode.Decimation
73
74 @note The enabled state does not change when calling this function.
75
76 @return
77 """
79
80 @property
81 def x(self) -> int:
82 """!
83 @brief
84 Gets the current number of columns used for decimation.
85
86 @return The current number of columns used for decimation.
87 The decimation algorithm uses one column, skips the next x - 1 columns, and repeats this process.
88 """
89 return self._module.x
90
91 @x.setter
92 def x(self, value: int) -> None:
93 """!
94 @brief
95 Sets the number of columns used for decimation.
96
97 @param value: The number of columns used for decimation.
98 The decimation algorithm uses one column, skips the next x - 1 columns, and repeats this process.
99 Valid values are within the range returned by object.range.
100
101 @exception OutOfRangeException: If value is outside the valid range.
102 """
103 self._module.x = value
104
105 @property
106 def y(self) -> int:
107 """!
108 @brief
109 Gets the current number of rows used for decimation.
110 @return The current number of rows used for decimation.
111 The decimation algorithm uses one row, skips the next y - 1 rows, and repeats this process.
112 """
113 return self._module.y
114
115 @y.setter
116 def y(self, value: int) -> None:
117 """!
118 @brief
119 Sets the number of rows used for decimation.
120
121 @param value: The number of rows used for decimation.
122 The decimation algorithm uses one row, skips the next y - 1 rows, and repeats this process.
123 Valid values are within the range returned by object.range.
124
125 @exception OutOfRangeException: If value is outside the valid range.
126 """
127 self._module.y = value
128
129 @property
130 def range(self) -> Interval:
131 """!
132 @brief
133 Gets the valid range for the decimation factors x and y.
134
135 The returned interval specifies the minimum and maximum values that can be passed to the property x or y.
136
137 @return An IntervalU representing the valid decimation factor range.
138 """
139 return self._module.range
None reset_to_default(self)
Resets all settings to their defaults.
None __init__(self, DownsamplingModule module)
Creates a DecimationFeature for an existing downsampling module.
int y(self)
Gets the current number of rows used for decimation.
bool enabled(self)
Gets whether this feature is currently enabled.
int x(self)
Gets the current number of columns used for decimation.
Interval range(self)
Gets the valid range for the decimation factors x and y.
Abstract base class for all image processing pipeline features.
Definition ifeature.py:6