IDS peak ICV v1.1.0
Loading...
Searching...
No Matches
ColorCorrectionFeature Class Reference
Inheritance diagram for ColorCorrectionFeature:

Public Member Functions

None __init__ (self, ColorMatrixTransformationModule module)
 Creates a ColorCorrectionFeature for an existing color matrix transformation module.
 
bool enabled (self)
 Indicates whether the feature is currently enabled.
 
None enabled (self, bool value)
 Enables or disables the feature.
 
None reset_to_default (self)
 Resets the color correction matrix to identity matrix.
 
numpy.ndarray matrix (self)
 Gets the current color correction matrix.
 
None matrix (self, numpy.ndarray matrix)
 Sets the color correction matrix.
 

Protected Attributes

 _module = module
 

Detailed Description

Color correction applies a 3x3 color correction matrix to the image.

Supported pixel formats
  • BGR8
  • BGRa8
  • RGB8
  • RGBa8
  • BGR10
  • BGRa10
  • RGB10
  • RGBa10
  • BGR12
  • BGRa12
  • RGB12
  • RGBa12

See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.

Color correction is typically used to convert colors from a camera sensor’s native RGB space to a standard color space, or to perform color balancing and correction.

When performing color correction, a 3x3 color correction matrix is applied to the color values of the image.

The color correction matrix is represented as a 3×3 float array::

+--------+--------+--------+
| m_00   | m_01   | m_02   |
+--------+--------+--------+
| m_10   | m_11   | m_12   |
+--------+--------+--------+
| m_20   | m_21   | m_22   |
+--------+--------+--------+

Each element m_ij defines how much of the input channel j contributes to the output channel i. For example, m_01 is the contribution of the green input to the red output.

The matrix is applied as follows:

red_value_out = m_00 * red_value_in + m_01 * green_value_in + m_02 * blue_value_in;
green_value_out = m_10 * red_value_in + m_11 * green_value_in + m_12 * blue_value_in;
blue_value_out = m_20 * red_value_in + m_21 * green_value_in + m_22 * blue_value_in;

where red_value_in, green_value_in, and blue_value_in are the input red, green, and blue channel values, respectively, and red_value_out, green_value_out, and blue_value_out are the corresponding corrected output values. All RGB values are normalized to the range [0.0, 1.0].

Warning
Improper color correction matrices may result in color shifts, clipping, or unnatural colors.

The default value for the color correction matrix is the identity matrix.

Since
ids_peak_icv 1.0

Definition at line 9 of file color_correction_feature.py.

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self,
ColorMatrixTransformationModule module )

Creates a ColorCorrectionFeature for an existing color matrix transformation module.

Parameters
moduleReference to the underlying module
Since
ids_peak_icv 1.0

Definition at line 53 of file color_correction_feature.py.

Member Function Documentation

◆ enabled() [1/2]

bool enabled ( self)

Indicates whether the feature is currently enabled.

Returns
True if enabled; otherwise, False.
Since
ids_peak_icv 1.0

Reimplemented from IFeature.

Definition at line 64 of file color_correction_feature.py.

◆ enabled() [2/2]

None enabled ( self,
bool value )

Enables or disables the feature.

Parameters
valueSet to True to enable the feature, or False to disable it.
Since
ids_peak_icv 1.0

Reimplemented from IFeature.

Definition at line 75 of file color_correction_feature.py.

◆ matrix() [1/2]

numpy.ndarray matrix ( self)

Gets the current color correction matrix.

Returns
The color correction matrix currently set.
Since
ids_peak_icv 1.0

Definition at line 96 of file color_correction_feature.py.

◆ matrix() [2/2]

None matrix ( self,
numpy.ndarray matrix )

Sets the color correction matrix.

Parameters
matrixA floating-point matrix representing the color correction matrix.
Since
ids_peak_icv 1.0

Definition at line 107 of file color_correction_feature.py.

◆ reset_to_default()

None reset_to_default ( self)

Resets the color correction matrix to identity matrix.

Note
The enabled state does not change when calling this function.
Since
ids_peak_icv 1.0

Reimplemented from IFeature.

Definition at line 85 of file color_correction_feature.py.

Field Documentation

◆ _module

_module = module
protected

Definition at line 61 of file color_correction_feature.py.