IDS peak ICV v1.1.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 Indicates whether the feature is currently enabled.
44 @return True if enabled; otherwise, False.
45
46 @since ids_peak_icv 1.0
47 """
48 return self._module.enabled
49
50 @enabled.setter
51 def enabled(self, value: bool) -> None:
52 """!
53 @brief
54 Enables or disables the feature.
55 @param value: Set to True to enable the feature, or False to disable it.
56
57 @since ids_peak_icv 1.0
58 """
59 self._module.enabled = value
60
61 def reset_to_default(self) -> None:
62 """!
63 @brief
64 Resets the pixel list (empty list).
65
66 @note The enabled state does not change when calling this function.
67
68 @since ids_peak_icv 1.0
69 """
71
72 @property
73 def hotpixel_list(self) -> np.ndarray:
74 """!
75 @brief
76 Gets the current pixel list.
77 @return The pixel list currently set.
78
79 @since ids_peak_icv 1.0
80 """
81 return self._module.hotpixel_list
82
83 @hotpixel_list.setter
84 def hotpixel_list(self, pixel_list: np.ndarray) -> None:
85 """!
86 @brief
87 Sets the pixel list.
88 @param pixel_list: A list of points representing the hotpixel.
89
90 @since ids_peak_icv 1.0
91 """
92 self._module.hotpixel_list = pixel_list
93
94 def detect(self, image: Image, sensitivity: int = 3, gain_factor: float = 1.0) -> None:
95 """!
96 @brief
97 Performs immediate hot pixel detection on the given image.
98
99 This method analyzes the provided image and detects hot pixels based on the
100 sensitivity setting. The results are stored internally and can be accessed using pixel_list.
101
102 Note: Calling this function will overwrite any existing hot pixel list previously set via pixel_list.
103
104 @param image: The input image to analyze for hot pixel detection.
105 @param sensitivity: Sensitivity for hot pixel detection. A higher sensitivity
106 may result in detecting more hot pixels, including possible
107 false positives.
108 @param gain_factor: Gain factor applied to the image. Used to account for
109 increased noise levels when detecting hot pixels.
110
111 @since ids_peak_icv 1.0
112 """
113 self._module.detect(image, sensitivity, gain_factor)
HotpixelCorrection detects and corrects hot pixels in camera images.
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