IDS peak ICV v1.6.0
Loading...
Searching...
No Matches
UnpackModule Class Reference
Inheritance diagram for UnpackModule:

Public Member Functions

None __init__ (self)
 Creates an instance of class UnpackModule.
 
None __del__ (self)
 
int target_bit_depth (self)
 Get the target bit depth used during image processing.
 
None target_bit_depth (self, int bit_depth)
 Set the target bit depth for image processing.
 
ProcessingPolicy processing_policy (self)
 Get the currently configured processing policy.
 
None processing_policy (self, ProcessingPolicy policy)
 Set the processing policy.
 
bool enabled (self)
 Indicates whether the unpack module is enabled.
 
None enabled (self, bool enabled)
 This property cannot be changed.
 
str type (self)
 Returns the type of the module for serialization purposes.
 
Image process (self, Image input_image)
 Converts a packed pixel format image into an unpacked Bayer or monochrome format.
 
None reset_to_default (self)
 Resets all settings to their defaults.
 
None release_buffers (self)
 Frees unused internal buffers.
 
None serialize (self, IArchive archive)
 This function has no effect on the Unpack module.
 
None deserialize (self, IArchive archive)
 This function has no effect on the Unpack module.
 

Static Public Attributes

 DEFAULT_POLICY = ProcessingPolicy.FAST
 
int DEFAULT_TARGET_BIT_DEPTH = 8
 

Protected Member Functions

int _get_output_bit_depth (self, int input_bit_depth)
 
PixelFormat _get_output_pixel_format (self, PixelFormat input_pixel_format, int output_bit_depth)
 

Static Protected Member Functions

PixelFormat _bayer_bg_format (int bit_depth)
 
PixelFormat _bayer_gb_format (int bit_depth)
 
PixelFormat _bayer_gr_format (int bit_depth)
 
PixelFormat _bayer_rg_format (int bit_depth)
 
PixelFormat _mono_format (int bit_depth)
 

Protected Attributes

 _handle = image_converter_handle
 
int _target_bit_depth = self.DEFAULT_TARGET_BIT_DEPTH
 
ProcessingPolicy _policy = self.DEFAULT_POLICY
 

Detailed Description

Unpack is an image pipeline module that converts packed pixel formats into corresponding unpacked Bayer or mono formats.

The unpack module is always enabled and cannot be disabled. It converts input images with packed pixel formats into their corresponding unpacked Bayer or monochrome formats. The output bit depth depends on the applied processing policy and the specified target bit depth.

Default configuration:

  • Target bit depth: 8
  • Processing policy: ProcessingPolicy.FAST
Since
ids_peak_icv 1.0

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self)

Creates an instance of class UnpackModule.

Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

◆ __del__()

None __del__ ( self)

Member Function Documentation

◆ _bayer_bg_format()

PixelFormat _bayer_bg_format ( int bit_depth)
staticprotected

◆ _bayer_gb_format()

PixelFormat _bayer_gb_format ( int bit_depth)
staticprotected

◆ _bayer_gr_format()

PixelFormat _bayer_gr_format ( int bit_depth)
staticprotected

◆ _bayer_rg_format()

PixelFormat _bayer_rg_format ( int bit_depth)
staticprotected

◆ _get_output_bit_depth()

int _get_output_bit_depth ( self,
int input_bit_depth )
protected

◆ _get_output_pixel_format()

PixelFormat _get_output_pixel_format ( self,
PixelFormat input_pixel_format,
int output_bit_depth )
protected

◆ _mono_format()

PixelFormat _mono_format ( int bit_depth)
staticprotected

◆ deserialize()

None deserialize ( self,
IArchive archive )

This function has no effect on the Unpack module.

Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

◆ enabled() [1/2]

bool enabled ( self)

Indicates whether the unpack module is enabled.

This property always returns True. Setting this property has no effect.

Returns
True
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

◆ enabled() [2/2]

None enabled ( self,
bool enabled )

This property cannot be changed.

The module remains enabled to guarantee correct operation of following modules.

Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

◆ process()

Image process ( self,
Image input_image )

Converts a packed pixel format image into an unpacked Bayer or monochrome format.

This function unpacks the input image from a packed format to its corresponding unpacked Bayer or monochrome format.

Note
This operation disregards any specified image regions and processes the entire image.
Parameters
input_imageThe packed input image to unpack.
Returns
The unpacked output image with the downsampled bit depth.
Since
ids_peak_icv 1.0

◆ processing_policy() [1/2]

ProcessingPolicy processing_policy ( self)

Get the currently configured processing policy.

Returns
The active processing policy.
Since
ids_peak_icv 1.0

◆ processing_policy() [2/2]

None processing_policy ( self,
ProcessingPolicy policy )

Set the processing policy.

Parameters
policyThe desired processing policy.
Since
ids_peak_icv 1.0

◆ release_buffers()

None release_buffers ( self)

Frees unused internal buffers.

This module uses pre-allocated internal buffers to accelerate conversions. When the image size or pixel format changes, new buffers are allocated, which may cause the internal buffer pool to grow over time. This function can be used to release unused buffers and reduce memory usage.

Note
Avoid calling this function too frequently (e.g., after every resize or format change), as it introduces some overhead.
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

◆ serialize()

None serialize ( self,
IArchive archive )

This function has no effect on the Unpack module.

Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

◆ target_bit_depth() [1/2]

int target_bit_depth ( self)

Get the target bit depth used during image processing.

This value specifies the bit depth the module will aim for when unpacking packed pixel formats. The actual output bit depth depends on the selected :class:ProcessingPolicy.

Returns
The currently configured target bit depth.
Since
ids_peak_icv 1.0

◆ target_bit_depth() [2/2]

None target_bit_depth ( self,
int bit_depth )

Set the target bit depth for image processing.

The target bit depth acts as a reference when deciding how to unpack packed pixel formats. The actual resulting bit depth depends on the selected :class:ProcessingPolicy:

  • Fast: The output bit depth is the minimum of the input image bit depth and the target bit depth.
  • Balanced: The output bit depth is the same as the input image bit depth (the target value is ignored).
  • Enhanced: The output bit depth is the maximum of the input image bit depth and the target bit depth.

This allows you to downsample, preserve, or enhance bit depth depending on your use case.

Parameters
bit_depthThe desired target bit depth (e.g., 8, 10, 12).
Since
ids_peak_icv 1.0

◆ type()

str type ( self)

Returns the type of the module for serialization purposes.

Returns
Module type
Since
ids_peak_icv 1.0

Field Documentation

◆ _handle

_handle = image_converter_handle
protected

◆ _policy

ProcessingPolicy _policy = self.DEFAULT_POLICY
protected

◆ _target_bit_depth

_target_bit_depth = self.DEFAULT_TARGET_BIT_DEPTH
protected

◆ DEFAULT_POLICY

DEFAULT_POLICY = ProcessingPolicy.FAST
static

◆ DEFAULT_TARGET_BIT_DEPTH

int DEFAULT_TARGET_BIT_DEPTH = 8
static