
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:
| None __init__ | ( | self | ) |
| None __del__ | ( | self | ) |
|
protected |
|
protected |
| 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.
This controls the order and number of color channels in the converted image.
| layout | Desired channel layout |
| DebayerConversionPolicy conversion_policy | ( | self | ) |
Get the current conversion policy.
| 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. |
| 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.
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). |
| ProcessingPolicy processing_policy | ( | self | ) |
| 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. |
| 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.
| None reset_to_default | ( | self | ) |
Resets all settings to their defaults.
Default configuration:
| 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.
| 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.
The effective output bit depth depends on the selected :class:ProcessingPolicy:
| bit_depth | The desired target bit depth (e.g., 8, 10, 12). |
| str type | ( | self | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
|
static |
|
static |