1from __future__
import annotations
11 Digital black applies digital black correction to an image.
13 @supportedPixelformats{ToneCurveCorrection}
15 This feature adjusts the image luminance by first subtracting a digital black and then normalizing the result.
16 This compensates for sensor digital black offsets.
17 The correction is applied independently to each channel in the image.
18 For RGB images, it is applied to each color channel (R, G, B), and for monochrome images,
19 it is applied to the single intensity channel.
21 The correction is performed using the following formula::
23 color_value_out = clamp((color_value_in - black) / (1.0 - black), 0.0, 1.0);
27 - color_value_in is the input channel value
28 - black is the digital black to be subtracted (in normalized units)
29 - color_value_out is the resulting output value
31 All input and output values are in the normalized range [0.0, 1.0].
33 The default value for digital black is 0.0.
35 @since ids_peak_icv 1.0
36 @ingroup ids_peak_icv_python_pipeline_features
39 def __init__(self, module: ToneCurveCorrectionModule) ->
None:
42 Creates a digital black feature for an existing tone curve correction module.
43 @param module: Reference to the underlying module
45 @since ids_peak_icv 1.0
53 Indicates whether the feature is currently enabled.
54 @return True if enabled; otherwise, False.
56 @since ids_peak_icv 1.0
58 return self.
_module.digital_black_enabled
64 Enables or disables the feature.
65 @param value: Set to True to enable the feature, or False to disable it.
67 @since ids_peak_icv 1.0
69 self.
_module.digital_black_enabled = value
74 Resets the black level value to 0.0.
76 @note The enabled state does not change when calling this function.
78 @since ids_peak_icv 1.0
86 Gets the current black level value.
87 @return The black level value currently set.
89 @since ids_peak_icv 1.0
91 return self.
_module.digital_black
94 def value(self, digital_black: float) ->
None:
97 Sets the black level value.
99 This value is subtracted from the input image channel values before normalizing it.
100 It typically represents sensor black offset.
102 @param digital_black: A floating-point value representing the digital black value in normalized units.
103 Valid values are within the range returned by range property.
105 @exception OutOfRangeException: If digital black value is outside the valid range.
107 @since ids_peak_icv 1.0
109 self.
_module.digital_black = digital_black
115 Retrieves the valid range for the black level value.
117 The returned interval specifies the minimum and maximum values that can be passed to value property.
119 @return An Interval representing the valid black level range.
121 @since ids_peak_icv 1.0
123 return self.
_module.digital_black_range
Digital black applies digital black correction to an image.
None reset_to_default(self)
Resets the black level value to 0.0.
float value(self)
Gets the current black level value.
None value(self, float digital_black)
Sets the black level value.
None __init__(self, ToneCurveCorrectionModule module)
Creates a digital black feature for an existing tone curve correction module.
bool enabled(self)
Indicates whether the feature is currently enabled.
Interval range(self)
Retrieves the valid range for the black level value.
Abstract base class for all image processing pipeline features.