IDS peak ICV v1.2.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 Indicates whether the feature is currently enabled.
49 @return True if enabled; otherwise, False.
50 """
51 return self._module.enabled
52
53 @enabled.setter
54 def enabled(self, value: bool) -> None:
55 """!
56 @brief
57 Enables or disables the feature.
58 @param value: Set to True to enable the feature, or False to disable it.
59 """
60 self._module.enabled = value
61
62 def reset_to_default(self) -> None:
63 """!
64 @brief
65 Resets all settings to the default configuration:
66 - x = 1
67 - y = 1
68 - DownsamplingMode.Decimation
69
70 @note The enabled state does not change when calling this function.
71
72 @return
73 """
75
76 @property
77 def x(self) -> int:
78 """!
79 @brief
80 Gets the current number of columns used for decimation.
81
82 @return The current number of columns used for decimation.
83 The decimation algorithm uses one column, skips the next x - 1 columns, and repeats this process.
84 """
85 return self._module.x
86
87 @x.setter
88 def x(self, value: int) -> None:
89 """!
90 @brief
91 Sets the number of columns used for decimation.
92
93 @param value: The number of columns used for decimation.
94 The decimation algorithm uses one column, skips the next x - 1 columns, and repeats this process.
95 Valid values are within the range returned by object.range.
96
97 @exception OutOfRangeException: If value is outside the valid range.
98 """
99 self._module.x = value
100
101 @property
102 def y(self) -> int:
103 """!
104 @brief
105 Gets the current number of rows used for decimation.
106 @return The current number of rows used for decimation.
107 The decimation algorithm uses one row, skips the next y - 1 rows, and repeats this process.
108 """
109 return self._module.y
110
111 @y.setter
112 def y(self, value: int) -> None:
113 """!
114 @brief
115 Sets the number of rows used for decimation.
116
117 @param value: The number of rows used for decimation.
118 The decimation algorithm uses one row, skips the next y - 1 rows, and repeats this process.
119 Valid values are within the range returned by object.range.
120
121 @exception OutOfRangeException: If value is outside the valid range.
122 """
123 self._module.y = value
124
125 @property
126 def range(self) -> Interval:
127 """!
128 @brief
129 Gets the valid range for the decimation factors x and y.
130
131 The returned interval specifies the minimum and maximum values that can be passed to the property x or y.
132
133 @return An IntervalU representing the valid decimation factor range.
134 """
135 return self._module.range
None reset_to_default(self)
Resets all settings to the default configuration:
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)
Indicates whether the 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