
Public Member Functions | |
| None | __init__ (self) |
| Creates an instance of the debayer module. | |
| None | __del__ (self) |
| str | type (self) |
| Returns the type of the module for serialization purposes. | |
| DebayerChannelLayout | channel_layout (self) |
| Get the output channel layout used for debayered images. | |
| None | channel_layout (self, DebayerChannelLayout layout) |
| Set the output channel layout for debayered images. | |
| DebayerConversionPolicy | conversion_policy (self) |
| Get the current conversion policy. | |
| None | conversion_policy (self, DebayerConversionPolicy policy) |
| Set the debayer conversion policy. | |
| int | target_bit_depth (self) |
| Get the target bit depth for processed images. | |
| None | target_bit_depth (self, int bit_depth) |
| Set the target bit depth for processed images. | |
| ProcessingPolicy | processing_policy (self) |
| Get the processing policy. | |
| None | processing_policy (self, ProcessingPolicy policy) |
| Set the processing policy. | |
| Image | process (self, Image input_image) |
| Converts a Bayer or mono image to a color image, or returns the input image unchanged. | |
| None | reset_to_default (self) |
| Resets all settings to their defaults. | |
| None | release_buffers (self) |
| Frees unused internal buffers. | |
| None | serialize (self, IArchive archive) |
| Serializes the object's internal state into the provided archive. | |
| None | deserialize (self, IArchive archive) |
| Restores the object's state from the provided archive. | |
Static Public Attributes | |
| DebayerChannelLayout | DEFAULT_CHANNEL_LAYOUT = DebayerChannelLayout.RGB |
| DebayerConversionPolicy | DEFAULT_CONVERSION_POLICY = DebayerConversionPolicy.BAYER_ONLY |
| int | DEFAULT_TARGET_BIT_DEPTH = 8 |
| ProcessingPolicy | DEFAULT_POLICY = ProcessingPolicy.FAST |
Protected Member Functions | |
| int | _get_output_bit_depth (self, int input_bit_depth) |
| PixelFormat | _get_output_format (self, PixelFormat input_pixel_format) |
Protected Attributes | |
| _handle = image_converter_handle | |
| DebayerChannelLayout | _channel_layout = self.DEFAULT_CHANNEL_LAYOUT |
| DebayerConversionPolicy | _conversion_policy = self.DEFAULT_CONVERSION_POLICY |
| int | _target_bit_depth = self.DEFAULT_TARGET_BIT_DEPTH |
| ProcessingPolicy | _policy = self.DEFAULT_POLICY |
| _enabled | |
Debayer is an image pipeline module that converts Bayer RAW images into standard color formats.
It performs demosaicing on Bayer-pattern RAW images, converting them into full-color images using configurable channel layouts such as RGB, BGR, RGBA, or BGRA. The bit depth of the output is inferred from the input, depending on the selected processing policy.
Default configuration:
Definition at line 16 of file debayer_module.py.
| None __init__ | ( | self | ) |
Creates an instance of the debayer module.
Reimplemented from ModuleBase.
Definition at line 40 of file debayer_module.py.
| None __del__ | ( | self | ) |
Definition at line 60 of file debayer_module.py.
|
protected |
Definition at line 305 of file debayer_module.py.
|
protected |
Definition at line 312 of file debayer_module.py.
| DebayerChannelLayout channel_layout | ( | self | ) |
Get the output channel layout used for debayered images.
Definition at line 77 of file debayer_module.py.
| None channel_layout | ( | self, | |
| DebayerChannelLayout | layout ) |
Set the output channel layout for debayered images.
This controls the order and number of color channels in the converted image.
| layout | Desired channel layout |
Definition at line 89 of file debayer_module.py.
| DebayerConversionPolicy conversion_policy | ( | self | ) |
Get the current conversion policy.
Definition at line 102 of file debayer_module.py.
| None conversion_policy | ( | self, | |
| DebayerConversionPolicy | policy ) |
Set the debayer conversion policy.
This policy determines which types of input images will be converted. All other image types are passed through unchanged.
| policy | The desired conversion policy. |
Definition at line 114 of file debayer_module.py.
| 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.
| archive | The source archive containing the serialized parameters. |
| CorruptedException | If Archive is malformed, misses keys or the values are invalid |
| NotSupportedException | If the 'Version' entry indicates an unsupported version. |
Reimplemented from ModuleBase.
Definition at line 280 of file debayer_module.py.
Converts a Bayer or mono image to a color image, or returns the input image unchanged.
A demosaicing algorithm is applied according to the configured conversion policy. The input image is returned unchanged if the module is disabled, the policy indicates bypass, or the image format is not eligible for conversion. Otherwise, the Bayer RAW image is converted to the configured output format.
| input_image | The input image (Bayer, mono, or already color). |
Definition at line 181 of file debayer_module.py.
| ProcessingPolicy processing_policy | ( | self | ) |
Get the processing policy.
Definition at line 157 of file debayer_module.py.
| None processing_policy | ( | self, | |
| ProcessingPolicy | policy ) |
Set the processing policy.
The processing policy defines how the target bit depth interacts with the input image bit depth.
| policy | The desired ProcessingPolicy. |
Definition at line 167 of file debayer_module.py.
| 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.
Definition at line 241 of file debayer_module.py.
| None reset_to_default | ( | self | ) |
Resets all settings to their defaults.
Default configuration:
Definition at line 221 of file debayer_module.py.
| None serialize | ( | self, | |
| IArchive | archive ) |
Serializes the object's internal state into the provided archive.
This function populates the given 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.
| archive | The target archive that will store the serialized parameters. |
Reimplemented from ModuleBase.
Definition at line 263 of file debayer_module.py.
| int target_bit_depth | ( | self | ) |
Get the target bit depth for processed images.
Definition at line 129 of file debayer_module.py.
| None target_bit_depth | ( | self, | |
| int | bit_depth ) |
Set the target bit depth for processed images.
The effective output bit depth depends on the selected :class:ProcessingPolicy:
| bit_depth | The desired target bit depth (e.g., 8, 10, 12). |
Definition at line 139 of file debayer_module.py.
| str type | ( | self | ) |
Returns the type of the module for serialization purposes.
Definition at line 65 of file debayer_module.py.
|
protected |
Definition at line 55 of file debayer_module.py.
|
protected |
Definition at line 56 of file debayer_module.py.
|
protected |
Definition at line 202 of file debayer_module.py.
|
protected |
Definition at line 54 of file debayer_module.py.
|
protected |
Definition at line 58 of file debayer_module.py.
|
protected |
Definition at line 57 of file debayer_module.py.
|
static |
Definition at line 35 of file debayer_module.py.
|
static |
Definition at line 36 of file debayer_module.py.
|
static |
Definition at line 38 of file debayer_module.py.
|
static |
Definition at line 37 of file debayer_module.py.