IDS peak ICV v1.4.0
Loading...
Searching...
No Matches
ColorCorrectionFeature Class Reference

#include <peak_icv/pipeline/features/peak_icv_color_correction_feature.hpp>

Inheritance diagram for ColorCorrectionFeature:

Public Member Functions

 ColorCorrectionFeature (detail::ColorMatrixTransformationModule &module)
 Creates a ColorCorrectionFeature for an existing color matrix transformation module.
 
void SetEnabled (bool enabled) override
 Enables or disables the feature.
 
bool IsEnabled () const override
 Gets whether this feature is currently enabled.
 
void ResetToDefault () override
 Resets the ColorCorrectionMatrix to the default.
 
void SetMatrix (const ColorCorrectionMatrix &matrix)
 Sets the ColorCorrectionMatrix.
 
ColorCorrectionMatrix GetMatrix () const
 Gets the current ColorCorrectionMatrix.
 

Detailed Description

Color correction applies a 3x3 ColorCorrectionMatrix to the image.

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 ColorCorrectionMatrix is applied to the color values of the image.

The ColorCorrectionMatrix 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.

Defaults
  • identity matrix
See also
ColorCorrectionMatrix, features::SaturationFeature, features::ChromaticAdaptionFeature
Since
ids_peak_icv 1.0

Constructor & Destructor Documentation

◆ ColorCorrectionFeature()

Creates a ColorCorrectionFeature for an existing color matrix transformation module.

Parameters
moduleReference to the underlying detail::ColorMatrixTransformationModule.
Since
ids_peak_icv 1.0

Member Function Documentation

◆ GetMatrix()

ColorCorrectionMatrix GetMatrix ( ) const
inline

Gets the current ColorCorrectionMatrix.

Returns
The current ColorCorrectionMatrix.
Since
ids_peak_icv 1.0

◆ IsEnabled()

bool IsEnabled ( ) const
inlineoverridevirtual

Gets whether this feature is currently enabled.

Returns
true if enabled; otherwise false.
Since
ids_peak_icv 1.0

Implements IFeature.

◆ ResetToDefault()

void ResetToDefault ( )
inlineoverridevirtual

Resets the ColorCorrectionMatrix to the default.

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

Implements IFeature.

◆ SetEnabled()

void SetEnabled ( bool enabled)
inlineoverridevirtual

Enables or disables the feature.

Parameters
enabledSet to true to enable, or false to disable.
Since
ids_peak_icv 1.0

Implements IFeature.

◆ SetMatrix()

void SetMatrix ( const ColorCorrectionMatrix & matrix)
inline

Sets the ColorCorrectionMatrix.

Parameters
matrixThe ColorCorrectionMatrix to set.
Since
ids_peak_icv 1.0