IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
hotpixel_correction_feature.py
Go to the documentation of this file.
1from __future__ import annotations
2
3import numpy as np
4
5from ids_peak_icv import Image
6from ids_peak_icv.pipeline._internal.hotpixel_correction_module import HotpixelCorrectionModule
8
9
11 """!
12 @brief
13 HotpixelCorrection detects and corrects hot pixels in camera images.
14
15 @supportedPixelformats{HotpixelCorrection}
16
17 The HotpixelCorrection class is responsible for identifying and correcting defective pixels that consistently
18 report higher-than-expected intensity values.
19
20 It allows fine-tuning of the detection sensitivity and management of a hot pixel
21 correction list, which is applied during image processing through the process() method.
22
23 The default value is an empty hotpixel correction list.
24
25 @since ids_peak_icv 1.0
26 @ingroup ids_peak_icv_python_pipeline_features
27 """
28
29 def __init__(self, module: HotpixelCorrectionModule) -> None:
30 """!
31 @brief
32 Creates a HotpixelCorrectionFeature for an existing hotpixel correction module.
33 @param module: Reference to the underlying module
34
35 @since ids_peak_icv 1.0
36 """
37 self._module = module
38
39 @property
40 def enabled(self) -> bool:
41 """!
42 @brief
43 Gets whether this feature is currently enabled.
44
45 @return True if enabled; otherwise False.
46
47 @since ids_peak_icv 1.0
48 """
49 return self._module.enabled
50
51 @enabled.setter
52 def enabled(self, enabled: bool) -> None:
53 """!
54 @brief
55 Enables or disables the feature.
56
57 @param enabled: True to enable, False to disable.
58
59 @since ids_peak_icv 1.0
60 """
61 self._module.enabled = enabled
62
63 def reset_to_default(self) -> None:
64 """!
65 @brief
66 Resets the hotpixel list to its default value (empty list).
67
68 @note The enabled state does not change when calling this function.
69
70 @since ids_peak_icv 1.0
71 """
73
74 @property
75 def hotpixel_list(self) -> np.ndarray:
76 """!
77 @brief
78 Gets the current pixel list.
79 @return The pixel list currently set.
80
81 @since ids_peak_icv 1.0
82 """
83 return self._module.hotpixel_list
84
85 @hotpixel_list.setter
86 def hotpixel_list(self, pixel_list: np.ndarray) -> None:
87 """!
88 @brief
89 Sets the pixel list.
90 @param pixel_list: A list of points representing the hotpixel.
91
92 @since ids_peak_icv 1.0
93 """
94 self._module.hotpixel_list = pixel_list
95
96 def detect(self, image: Image, sensitivity: int = 3, gain_factor: float = 1.0) -> None:
97 """!
98 @brief
99 Performs immediate hot pixel detection on the given image.
100
101 This method analyzes the provided image and detects hot pixels based on the
102 sensitivity setting. The results are stored internally and can be accessed using pixel_list.
103
104 Note: Calling this function will overwrite any existing hot pixel list previously set via pixel_list.
105
106 @param image: The input image to analyze for hot pixel detection.
107 @param sensitivity: Sensitivity for hot pixel detection. A higher sensitivity
108 may result in detecting more hot pixels, including possible
109 false positives.
110 @param gain_factor: Gain factor applied to the image. Used to account for
111 increased noise levels when detecting hot pixels.
112
113 @since ids_peak_icv 1.0
114 """
115 self._module.detect(image, sensitivity, gain_factor)
HotpixelCorrection detects and corrects hot pixels in camera images.
None reset_to_default(self)
Resets the hotpixel list to its default value (empty list).
None __init__(self, HotpixelCorrectionModule module)
Creates a HotpixelCorrectionFeature for an existing hotpixel correction module.
None detect(self, Image image, int sensitivity=3, float gain_factor=1.0)
Performs immediate hot pixel detection on the given image.
Abstract base class for all image processing pipeline features.
Definition ifeature.py:6