IDS peak ICV v1.4.0
Loading...
Searching...
No Matches
GainFeature Class Reference
Inheritance diagram for GainFeature:

Public Member Functions

None __init__ (self, GainModule module)
 Creates a gain feature for an existing gain module.
 
bool enabled (self)
 Gets whether this feature is currently enabled.
 
None enabled (self, bool enabled)
 Enables or disables the feature.
 
None reset_to_default (self)
 Resets the all gain values to their default value (1.0).
 
float red (self)
 Retrieves the current red gain.
 
None red (self, float value)
 Sets the red gain value.
 
float green (self)
 Retrieves the current green gain.
 
None green (self, float value)
 Sets the green gain value.
 
float blue (self)
 Retrieves the current blue gain.
 
None blue (self, float value)
 Sets the blue gain value.
 
float master (self)
 Retrieves the current master gain.
 
None master (self, float value)
 Sets the master gain value.
 
Interval range (self)
 Retrieves the valid range for the gamma correction exponent.
 

Protected Attributes

 _module = module
 

Detailed Description

Gain is an image pipeline feature that applies gain correction to an image.

Supported pixel formats
  • Mono8
  • Mono10
  • Mono12
  • Mono16
  • BayerBG8
  • BayerBG10
  • BayerBG12
  • BayerGB8
  • BayerGB10
  • BayerGB12
  • BayerRG8
  • BayerRG10
  • BayerRG12
  • BayerGR8
  • BayerGR10
  • BayerGR12

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

Gain is used to adjust pixel intensities either uniformly across all color channels using the master gain, or individually per channel using the red, green, and blue gains. With master gain, image brightness can be increased. With color gains, the white balance can be adjusted. For color images, gain is applied as follows::

red_value_out   = red_value_in   * red_gain   * master_gain
green_value_out = green_value_in * green_gain * master_gain
blue_value_out  = blue_value_in  * blue_gain  * master_gain

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 output values. All RGB values are normalized to the range [0.0, 1.0]. For mono images, the color gains are ignored and applied as follows::

gray_value_out = gray_value_in * master_gain

where gray_value_in is the input and gray_value_out the output value, normalized to the range [0.0, 1.0].

Warning: Excessive gain values may cause clipping and loss of image detail in bright areas.

Default configuration:

  • Master gain = 1.0
  • Red gain = 1.0
  • Green gain = 1.0
  • Blue gain = 1.0
Since
ids_peak_icv 1.0

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self,
GainModule module )

Creates a gain feature for an existing gain module.

Parameters
moduleReference to the underlying module
Since
ids_peak_icv 1.0

Member Function Documentation

◆ blue() [1/2]

float blue ( self)

Retrieves the current blue gain.

Returns
The current blue gain.
Since
ids_peak_icv 1.0

◆ blue() [2/2]

None blue ( self,
float value )

Sets the blue gain value.

Sets the color gain for the blue channel. The valid range for the gain value can be obtained using the range property.

Parameters
valueThe blue gain value to set.
Exceptions
OutOfRangeExceptionIf the gain value is outside the valid range.
Since
ids_peak_icv 1.0

◆ enabled() [1/2]

bool enabled ( self)

Gets whether this feature is currently enabled.

Returns
True if enabled; otherwise False.
Since
ids_peak_icv 1.0

Reimplemented from IFeature.

◆ enabled() [2/2]

None enabled ( self,
bool enabled )

Enables or disables the feature.

Parameters
enabledTrue to enable, False to disable.
Since
ids_peak_icv 1.0

Reimplemented from IFeature.

◆ green() [1/2]

float green ( self)

Retrieves the current green gain.

Returns
The current green gain.
Since
ids_peak_icv 1.0

◆ green() [2/2]

None green ( self,
float value )

Sets the green gain value.

Sets the color gain for the green channel. The valid range for the gain value can be obtained using the range property.

Parameters
valueThe green gain value to set.
Exceptions
OutOfRangeExceptionIf the gain value is outside the valid range.
Since
ids_peak_icv 1.0

◆ master() [1/2]

float master ( self)

Retrieves the current master gain.

Returns
The current master gain.
Since
ids_peak_icv 1.0

◆ master() [2/2]

None master ( self,
float value )

Sets the master gain value.

Sets the color gain for the master channel. The valid range for the gain value can be obtained using the range property.

Parameters
valueThe master gain value to set.
Exceptions
OutOfRangeExceptionIf the gain value is outside the valid range.
Since
ids_peak_icv 1.0

◆ range()

Interval range ( self)

Retrieves the valid range for the gamma correction exponent.

The returned interval specifies the minimum and maximum values that can be passed to value property.

Returns
An Interval representing the valid gamma range.
Since
ids_peak_icv 1.0

◆ red() [1/2]

float red ( self)

Retrieves the current red gain.

Returns
The current red gain.
Since
ids_peak_icv 1.0

◆ red() [2/2]

None red ( self,
float value )

Sets the red gain value.

Sets the color gain for the red channel. The valid range for the gain value can be obtained using the range property.

Parameters
valueThe red gain value to set.
Exceptions
OutOfRangeExceptionIf the gain value is outside the valid range.
Since
ids_peak_icv 1.0

◆ reset_to_default()

None reset_to_default ( self)

Resets the all gain values to their default value (1.0).

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

Reimplemented from IFeature.

Field Documentation

◆ _module

_module = module
protected