
Public Member Functions | |
| None | __init__ (self, ColorMatrixTransformationModule module) |
| Creates a ChromaticAdaptionFeature for an existing color matrix transformation module. | |
| bool | enabled (self) |
| Indicates whether chromatic adaptation is enabled. | |
| None | enabled (self, bool value) |
| Enables or disables chromatic adaptation. | |
| None | reset_to_default (self) |
| Resets the chromatic adaption configuration to the default values. | |
| ColorSpace | target_color_space (self) |
| Retrieves the current target color space. | |
| None | target_color_space (self, ColorSpace value) |
| Sets the target color space. | |
| ChromaticAdaptionAlgorithm | algorithm (self) |
| Retrieves the current chromatic adaption algorithm. | |
| None | algorithm (self, ChromaticAdaptionAlgorithm value) |
| Sets the algorithm used for chromatic adaption. | |
| int | color_temperature (self) |
| Retrieves the current color temperature. | |
| None | color_temperature (self, int value) |
| Sets the color temperature of the light source. | |
| bool | has_color_temperature (self) |
| Checks whether a color temperature has been set. | |
| Range | color_temperature_range (self) |
| Returns the allowed temperature range for the current combination of color space and algorithm. | |
Protected Attributes | |
| _module = module | |
Adjusts to changes in lighting conditions to maintain consistent color perception despite variations in light sources.
In industrial imaging, white balance can fail due to the lack of a neutral reference in the image, such as when the scene contains no gray or white areas, or when the colors are unevenly distributed (as in images dominated by a single color). In these cases, traditional white balance algorithms, like the gray world method, may fail to produce accurate color corrections.
Chromatic adaptation provides an alternative solution by adjusting the image’s colors based on the known or estimated correlated color temperature of the light source.
Default Configuration:
Definition at line 12 of file chromatic_adaption_feature.py.
| None __init__ | ( | self, | |
| ColorMatrixTransformationModule | module ) |
Creates a ChromaticAdaptionFeature for an existing color matrix transformation module.
| module | Reference to the underlying ColorMatrixTransformationModule. |
Definition at line 37 of file chromatic_adaption_feature.py.
| ChromaticAdaptionAlgorithm algorithm | ( | self | ) |
Retrieves the current chromatic adaption algorithm.
Definition at line 111 of file chromatic_adaption_feature.py.
| None algorithm | ( | self, | |
| ChromaticAdaptionAlgorithm | value ) |
Sets the algorithm used for chromatic adaption.
The algorithms use a CAT (chromatic adaptation transform) matrix.
| value | The chromatic adaption algorithm to set. |
Definition at line 123 of file chromatic_adaption_feature.py.
| int color_temperature | ( | self | ) |
Retrieves the current color temperature.
| NotPossibleException | If the color temperature has not been set (it has no default value). |
Definition at line 137 of file chromatic_adaption_feature.py.
| None color_temperature | ( | self, | |
| int | value ) |
Sets the color temperature of the light source.
If no color temperature is explicitly set the chromatic adaption won't be applied.
| value | The color temperature in Kelvin to set. Must be within the allowed range. |
Definition at line 151 of file chromatic_adaption_feature.py.
| Range color_temperature_range | ( | self | ) |
Returns the allowed temperature range for the current combination of color space and algorithm.
Definition at line 175 of file chromatic_adaption_feature.py.
| bool enabled | ( | self | ) |
Indicates whether chromatic adaptation is enabled.
Reimplemented from IFeature.
Definition at line 49 of file chromatic_adaption_feature.py.
| None enabled | ( | self, | |
| bool | value ) |
Enables or disables chromatic adaptation.
| value | Set to True to enable the feature, or False to disable it. |
Reimplemented from IFeature.
Definition at line 61 of file chromatic_adaption_feature.py.
| bool has_color_temperature | ( | self | ) |
Checks whether a color temperature has been set.
Definition at line 163 of file chromatic_adaption_feature.py.
| None reset_to_default | ( | self | ) |
Resets the chromatic adaption configuration to the default values.
Reimplemented from IFeature.
Definition at line 72 of file chromatic_adaption_feature.py.
| ColorSpace target_color_space | ( | self | ) |
Retrieves the current target color space.
Definition at line 84 of file chromatic_adaption_feature.py.
| None target_color_space | ( | self, | |
| ColorSpace | value ) |
Sets the target color space.
A color space is a specific implementation of a color model, mapping colors to a defined range of values (e.g., standard primaries, white point, and gamma).
| value | The color space to set. |
Definition at line 96 of file chromatic_adaption_feature.py.
|
protected |
Definition at line 46 of file chromatic_adaption_feature.py.