IDS peak ICV v1.1.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 the default values:
 
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)
 Checks if the module is currently enabled.
 
None enabled (self, bool value)
 Sets the enabled state of this 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

Definition at line 14 of file transformation_module.py.

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self)

Creates a transformation module.

Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

Definition at line 31 of file transformation_module.py.

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.

Definition at line 243 of file transformation_module.py.

◆ enabled() [1/2]

bool enabled ( self)

Checks if the module is currently enabled.

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

Reimplemented from ModuleBase.

Definition at line 193 of file transformation_module.py.

◆ enabled() [2/2]

None enabled ( self,
bool value )

Sets the enabled state of this module.

Parameters
valueIf true, the module is enabled; otherwise, it is disabled.
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

Definition at line 205 of file transformation_module.py.

◆ 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

Definition at line 121 of file transformation_module.py.

◆ 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

Definition at line 133 of file transformation_module.py.

◆ 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

Definition at line 145 of file transformation_module.py.

◆ 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

Definition at line 157 of file transformation_module.py.

◆ 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

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

Reimplemented from IModule.

Definition at line 56 of file transformation_module.py.

◆ reset_to_default()

None reset_to_default ( self)

Resets all settings to the default values:

  • No Rotation
  • No Mirroring
Since
ids_peak_icv 1.0

Reimplemented from IModule.

Definition at line 107 of file transformation_module.py.

◆ 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

Definition at line 169 of file transformation_module.py.

◆ 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

Definition at line 181 of file transformation_module.py.

◆ 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.

Returns
The serialized module's internal state.
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

Definition at line 217 of file transformation_module.py.

◆ type()

str type ( self)

Returns the type of the module for serialization purposes.

Returns
Module type
Since
ids_peak_icv 1.0

Reimplemented from IModule.

Definition at line 46 of file transformation_module.py.

Field Documentation

◆ _mirror_enabled

_mirror_enabled = True
protected

Definition at line 43 of file transformation_module.py.

◆ _mirror_left_right

_mirror_left_right = self.DEFAULT_MIRROR_LEFT_RIGHT
protected

Definition at line 39 of file transformation_module.py.

◆ _mirror_up_down

_mirror_up_down = self.DEFAULT_MIRROR_UP_DOWN
protected

Definition at line 40 of file transformation_module.py.

◆ _rotation_angle

Rotation _rotation_angle = self.DEFAULT_ROTATION_ANGLE
protected

Definition at line 41 of file transformation_module.py.

◆ _rotation_enabled

_rotation_enabled = True
protected

Definition at line 42 of file transformation_module.py.

◆ DEFAULT_MIRROR_LEFT_RIGHT

bool DEFAULT_MIRROR_LEFT_RIGHT = False
static

Definition at line 27 of file transformation_module.py.

◆ DEFAULT_MIRROR_UP_DOWN

bool DEFAULT_MIRROR_UP_DOWN = False
static

Definition at line 28 of file transformation_module.py.

◆ DEFAULT_ROTATION_ANGLE

Rotation DEFAULT_ROTATION_ANGLE = Rotation.NO_ROTATION
static

Definition at line 29 of file transformation_module.py.

◆ mirror_left_right

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

Definition at line 271 of file transformation_module.py.

◆ mirror_up_down

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

Definition at line 270 of file transformation_module.py.

◆ rotation_angle

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

Definition at line 274 of file transformation_module.py.

◆ version

version

Definition at line 230 of file transformation_module.py.