
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:
| None __init__ | ( | self, | |
| ColorMatrixTransformationModule | module ) |
Creates a ChromaticAdaptionFeature for an existing color matrix transformation module.
| module | Reference to the underlying ColorMatrixTransformationModule. |
| ChromaticAdaptionAlgorithm algorithm | ( | self | ) |
Retrieves the current chromatic adaption algorithm.
| 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. |
| int color_temperature | ( | self | ) |
Retrieves the current color temperature.
| NotPossibleException | If the color temperature has not been set (it has no default value). |
| 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. |
| Range color_temperature_range | ( | self | ) |
Returns the allowed temperature range for the current combination of color space and algorithm.
| bool enabled | ( | self | ) |
Indicates whether chromatic adaptation is enabled.
Reimplemented from IFeature.
| 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.
| bool has_color_temperature | ( | self | ) |
Checks whether a color temperature has been set.
| None reset_to_default | ( | self | ) |
Resets the chromatic adaption configuration to the default values.
Reimplemented from IFeature.
| ColorSpace target_color_space | ( | self | ) |
Retrieves the current target color space.
| 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. |
|
protected |