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

Public Member Functions

None __init__ (self)
 Creates a transformation module.
 
str type (self)
 Returns the type of the module for serialization purposes.
 
Image process (self, Image input)
 Processes the input image and returns a mirrored and/or rotated copy based on current settings.
 
None reset_to_default (self)
 Resets all settings to their defaults.
 
bool mirror_left_right (self)
 Gets the current left-right mirroring setting.
 
None mirror_left_right (self, bool value)
 Sets whether the image should be mirrored left-right.
 
bool mirror_up_down (self)
 Gets the current up-down mirroring setting.
 
None mirror_up_down (self, bool value)
 Sets whether the image should be mirrored up-down.
 
Rotation rotation_angle (self)
 Gets the current rotation angle.
 
None rotation_angle (self, Rotation value)
 Sets the desired rotation angle.
 
bool enabled (self)
 Gets whether this module is enabled.
 
None enabled (self, bool enabled)
 Enables or disables the module.
 
None serialize (self, IArchive archive)
 Serializes the object's internal state into an archive.
 
None deserialize (self, IArchive archive)
 Restores the object's state from the provided archive.
 

Data Fields

 version
 
 mirror_up_down = mirror_archive.get("UpDown", bool)
 
 mirror_left_right = mirror_archive.get("LeftRight", bool)
 
 rotation_angle = Rotation(rotation_archive.get("Angle", int))
 

Static Public Attributes

bool DEFAULT_MIRROR_LEFT_RIGHT = False
 
bool DEFAULT_MIRROR_UP_DOWN = False
 
Rotation DEFAULT_ROTATION_ANGLE = Rotation.NO_ROTATION
 

Protected Attributes

bool _mirror_left_right = self.DEFAULT_MIRROR_LEFT_RIGHT
 
bool _mirror_up_down = self.DEFAULT_MIRROR_UP_DOWN
 
Rotation _rotation_angle = self.DEFAULT_ROTATION_ANGLE
 
bool _rotation_enabled = True
 
bool _mirror_enabled = True
 

Detailed Description

Transformation is an image pipeline module that provides mirror and rotation functionality.

Default configuration:

  • No Rotation
  • No Mirroring
Since
ids_peak_icv 1.0

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self)

Creates a transformation module.

Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

Member Function Documentation

◆ deserialize()

None deserialize ( self,
IArchive archive )

Restores the object's state from the provided archive.

This function reads and applies all necessary parameters from the given archive to reconstruct the internal state of the object. It ensures that the object is restored to a valid and consistent state.

Note
This function requires that the archive contains all expected fields as produced by a corresponding serialize call.
Parameters
archiveThe source archive containing the serialized parameters.
Exceptions
CorruptedExceptionIf Archive is malformed, misses keys or the values are invalid
NotSupportedExceptionIf the 'Version' entry indicates an unsupported version or if the rotation angle is not transformable into RotationAngle.
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

◆ enabled() [1/2]

bool enabled ( self)

Gets whether this module is enabled.

When disabled, :func:process returns the input image unchanged.

Returns
True if the module is enabled, False otherwise.
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

◆ enabled() [2/2]

None enabled ( self,
bool enabled )

Enables or disables the module.

When disabled, :func:process returns the input image unchanged.

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

Reimplemented from ModuleBase.

◆ mirror_left_right() [1/2]

bool mirror_left_right ( self)

Gets the current left-right mirroring setting.

Returns
True if left-right mirroring is enabled so that left and right will be flipped.
Since
ids_peak_icv 1.0

◆ mirror_left_right() [2/2]

None mirror_left_right ( self,
bool value )

Sets whether the image should be mirrored left-right.

Parameters
valueIf true, the image will be mirrored along the vertical axis.
Since
ids_peak_icv 1.0

◆ mirror_up_down() [1/2]

bool mirror_up_down ( self)

Gets the current up-down mirroring setting.

Returns
True if up-down mirroring is enabled so that up and down will be flipped.
Since
ids_peak_icv 1.0

◆ mirror_up_down() [2/2]

None mirror_up_down ( self,
bool value )

Sets whether the image should be mirrored up-down.

Parameters
valueIf true, the image will be mirrored along the horizontal axis.
Since
ids_peak_icv 1.0

◆ process()

Image process ( self,
Image input )

Processes the input image and returns a mirrored and/or rotated copy based on current settings.

Supported pixel formats
  • BayerGR8
  • BayerGR10
  • BayerGR12
  • BayerRG8
  • BayerRG10
  • BayerRG12
  • BayerGB8
  • BayerGB10
  • BayerGB12
  • BayerBG8
  • BayerBG10
  • BayerBG12
  • Mono8
  • Mono10
  • Mono12
  • Mono16
  • Confidence8
  • Confidence16
  • Coord3D_C8
  • Coord3D_C16
  • Coord3D_C32f
  • Coord3D_ABC32f
  • RGB8
  • RGB10
  • RGB12
  • BGR8
  • BGR10
  • BGR12
  • RGBa8
  • RGBa10
  • RGBa12
  • BGRa8
  • BGRa10
  • BGRa12
  • Mono32fIDS
  • RGB32fIDS
  • Mono32f
  • RGB32f

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

Note
When processing images with a Bayer pattern, the result may have a different pixel format, though the bit depth remains unchanged.
This operation disregards any specified image regions and processes the entire image.
Parameters
inputThe input image to be processed.
Returns
A new image object that is the transformed result of the input.
Exceptions
NotSupportedExceptionIf the image has any other than the supported pixel formats.
Since
ids_peak_icv 1.0

◆ reset_to_default()

None reset_to_default ( self)

Resets all settings to their defaults.

Default configuration:

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

◆ rotation_angle() [1/2]

Rotation rotation_angle ( self)

Gets the current rotation angle.

Returns
The currently configured rotation angle.
Since
ids_peak_icv 1.0

◆ rotation_angle() [2/2]

None rotation_angle ( self,
Rotation value )

Sets the desired rotation angle.

Parameters
valueThe rotation angle to apply (see RotationAngle enum).
Since
ids_peak_icv 1.0

◆ serialize()

None serialize ( self,
IArchive archive )

Serializes the object's internal state into an archive.

This function populates an archive with all parameters required to fully represent the current state of the object. It ensures that the object can be reconstructed or transmitted accurately by saving all relevant data members in a consistent and structured format.

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

◆ _mirror_enabled

_mirror_enabled = True
protected

◆ _mirror_left_right

_mirror_left_right = self.DEFAULT_MIRROR_LEFT_RIGHT
protected

◆ _mirror_up_down

_mirror_up_down = self.DEFAULT_MIRROR_UP_DOWN
protected

◆ _rotation_angle

Rotation _rotation_angle = self.DEFAULT_ROTATION_ANGLE
protected

◆ _rotation_enabled

_rotation_enabled = True
protected

◆ DEFAULT_MIRROR_LEFT_RIGHT

bool DEFAULT_MIRROR_LEFT_RIGHT = False
static

◆ DEFAULT_MIRROR_UP_DOWN

bool DEFAULT_MIRROR_UP_DOWN = False
static

◆ DEFAULT_ROTATION_ANGLE

Rotation DEFAULT_ROTATION_ANGLE = Rotation.NO_ROTATION
static

◆ mirror_left_right

mirror_left_right = mirror_archive.get("LeftRight", bool)

◆ mirror_up_down

mirror_up_down = mirror_archive.get("UpDown", bool)

◆ rotation_angle

rotation_angle = Rotation(rotation_archive.get("Angle", int))

◆ version

version