IDS peak ICV v1.5.0
Loading...
Searching...
No Matches
GainModule Class Reference
Inheritance diagram for GainModule:

Public Member Functions

None __init__ (self)
 Creates an instance of the gain module.
 
None __del__ (self)
 
str type (self)
 Returns the type of the module for serialization purposes.
 
None reset_to_default (self)
 Resets all gain values to their default value (1.0).
 
float master (self)
 Returns the current master gain value.
 
None master (self, float value)
 Sets the master gain.
 
float red (self)
 Returns the current red gain value.
 
None red (self, float value)
 Sets the red channel gain.
 
float green (self)
 Returns the current green gain value.
 
None green (self, float value)
 Sets the green channel gain.
 
float blue (self)
 Returns the current blue gain value.
 
None blue (self, float value)
 Sets the blue channel gain.
 
Interval range (self)
 Returns the valid range for all gain values.
 
Image process (self, Image input_image)
 Processes the input image by applying gain correction (if enabled).
 
None serialize (self, IArchive archive)
 Serializes the module’s internal state into an archive.
 
None deserialize (self, IArchive archive)
 Restores the module’s state from an archive.
 

Data Fields

 master
 
 red
 
 green
 
 blue
 

Static Public Attributes

float DEFAULT_MASTER = 1.0
 
float DEFAULT_RED = 1.0
 
float DEFAULT_GREEN = 1.0
 
float DEFAULT_BLUE = 1.0
 
list SUPPORTED_PIXEL_FORMATS
 

Protected Member Functions

None _apply (self, _GainType gain_type, float value)
 
float _fetch (self, _GainType gain_type)
 

Protected Attributes

float _master = self.DEFAULT_MASTER
 
float _red = self.DEFAULT_RED
 
float _green = self.DEFAULT_GREEN
 
float _blue = self.DEFAULT_BLUE
 
 _handle = ctypes.c_void_p()
 
 _enabled
 

Detailed Description

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

This module adjusts the intensity or color gain of an image by modifying the master and per-channel (R, G, B) gain factors. It can be used to correct image brightness or color balance after acquisition.

The gain correction is applied independently to each channel, and is typically used as part of the early preprocessing stages of an image pipeline.

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)

Creates an instance of the gain module.

Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

◆ __del__()

None __del__ ( self)

Member Function Documentation

◆ _apply()

None _apply ( self,
_GainType gain_type,
float value )
protected

◆ _fetch()

float _fetch ( self,
_GainType gain_type )
protected

◆ blue() [1/2]

float blue ( self)

Returns the current blue gain value.

Since
ids_peak_icv 1.0

◆ blue() [2/2]

None blue ( self,
float value )

Sets the blue channel gain.

Parameters
valueGain value within valid range.
Since
ids_peak_icv 1.0

◆ deserialize()

None deserialize ( self,
IArchive archive )

Restores the module’s state from an archive.

Parameters
archiveArchive containing the serialized state.
Exceptions
CorruptedExceptionIf the archive is malformed.
NotSupportedExceptionIf version is unsupported.
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

◆ green() [1/2]

float green ( self)

Returns the current green gain value.

Since
ids_peak_icv 1.0

◆ green() [2/2]

None green ( self,
float value )

Sets the green channel gain.

Parameters
valueGain value within valid range.
Since
ids_peak_icv 1.0

◆ master() [1/2]

float master ( self)

Returns the current master gain value.

Since
ids_peak_icv 1.0

◆ master() [2/2]

None master ( self,
float value )

Sets the master gain.

Parameters
valueGain value within the valid range returned by :py:meth:range.
Exceptions
OutOfRangeExceptionIf value is outside the valid range.
Since
ids_peak_icv 1.0

◆ process()

Image process ( self,
Image input_image )

Processes the input image by applying gain correction (if enabled).

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.

Parameters
input_imageInput image to be processed.
Returns
Processed output image.
Since
ids_peak_icv 1.0

◆ range()

Interval range ( self)

Returns the valid range for all gain values.

The range applies to master and per-channel gains.

Returns
Interval representing the valid min/max gain values.
Since
ids_peak_icv 1.0

◆ red() [1/2]

float red ( self)

Returns the current red gain value.

Since
ids_peak_icv 1.0

◆ red() [2/2]

None red ( self,
float value )

Sets the red channel gain.

Parameters
valueGain value within valid range.
Since
ids_peak_icv 1.0

◆ reset_to_default()

None reset_to_default ( self)

Resets 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

◆ serialize()

None serialize ( self,
IArchive archive )

Serializes the module’s internal state into an archive.

Parameters
archiveThe target archive that will store the serialized parameters.
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

◆ type()

str type ( self)

Returns the type of the module for serialization purposes.

Returns
Module type
Since
ids_peak_icv 1.0

Field Documentation

◆ _blue

_blue = self.DEFAULT_BLUE
protected

◆ _enabled

_enabled
protected

◆ _green

_green = self.DEFAULT_GREEN
protected

◆ _handle

_handle = ctypes.c_void_p()
protected

◆ _master

_master = self.DEFAULT_MASTER
protected

◆ _red

_red = self.DEFAULT_RED
protected

◆ blue

blue

◆ DEFAULT_BLUE

float DEFAULT_BLUE = 1.0
static

◆ DEFAULT_GREEN

float DEFAULT_GREEN = 1.0
static

◆ DEFAULT_MASTER

float DEFAULT_MASTER = 1.0
static

◆ DEFAULT_RED

float DEFAULT_RED = 1.0
static

◆ green

green

◆ master

master

◆ red

red

◆ SUPPORTED_PIXEL_FORMATS

SUPPORTED_PIXEL_FORMATS
static
Initial value:
= [PixelFormat.BAYER_RG_8, PixelFormat.BAYER_RG_10, PixelFormat.BAYER_RG_12,
PixelFormat.BAYER_GR_8, PixelFormat.BAYER_GR_10, PixelFormat.BAYER_GR_12,
PixelFormat.BAYER_BG_8, PixelFormat.BAYER_BG_10, PixelFormat.BAYER_BG_12,
PixelFormat.BAYER_GB_8, PixelFormat.BAYER_GB_10, PixelFormat.BAYER_GB_12,
PixelFormat.MONO_8, PixelFormat.MONO_10, PixelFormat.MONO_12, PixelFormat.MONO_16]