IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
default_pipeline.py
Go to the documentation of this file.
1from io import StringIO
2from typing import Union, cast, Sequence
3
4from ids_peak_common.datatypes.iimageview import IImageView
5from ids_peak_common.datatypes.pixelformat import PixelFormat, Channel
6from ids_peak_common.pipeline.modules.imodule import IModule
7from ids_peak_common.pipeline.modules.iautofeature_module import IAutoFeature
8from ids_peak_common.pipeline.pipeline_base import PipelineBase
9from ids_peak_common.serialization import IArchive
10
11from ids_peak_icv.datatypes.image import Image
12from ids_peak_icv.exceptions import (InternalErrorException, CorruptedException, NotPossibleException,
13 NotSupportedException)
14from ids_peak_icv.pipeline._internal import SharpeningModule
15from ids_peak_icv.pipeline._internal.color_matrix_transformation_module import ColorMatrixTransformationModule
16from ids_peak_icv.pipeline._internal.debayer_module import (DebayerModule, DebayerConversionPolicy,
17 DebayerChannelLayout)
18from ids_peak_icv.pipeline._internal.downsampling_module import DownsamplingModule, DownsamplingMode
20from ids_peak_icv.pipeline._internal.hotpixel_correction_module import HotpixelCorrectionModule
21from ids_peak_icv.pipeline._internal.mono_conversion_module import MonoConversionModule
22from ids_peak_icv.pipeline._internal.pixelformat_conversion_module import PixelFormatConversionModule
23from ids_peak_icv.pipeline._internal.tone_curve_correction_module import ToneCurveCorrectionModule
24from ids_peak_icv.pipeline._internal.transformation_module import TransformationModule
26from ids_peak_icv.pipeline.features import IFeature
27from ids_peak_icv.pipeline.features import (MirrorFeature, RotationFeature,
28 BinningFeature, DecimationFeature, GainFeature, ColorCorrectionFeature,
29 DigitalBlackFeature, GammaFeature, HotpixelCorrectionFeature,
30 SaturationFeature, SharpeningFeature, ChromaticAdaptionFeature)
31from ids_peak_icv.pipeline.processing_policy import ProcessingPolicy
32from ids_peak_icv.serialization.archive import Archive
33from ids_peak_icv.serialization.deserializer import Deserializer
34from ids_peak_icv.serialization.serializer import Serializer
35
36
37class DefaultPipeline(PipelineBase):
38 """!
39 @brief
40 Image processing pipeline for sequential transformation of raw image frames.
41
42 The `Pipeline` class performs a series of configurable image processing steps on
43 raw or pre-processed image data. It is designed to support a complete transformation
44 workflow, from raw sensor input to final output format, with each stage modular
45 and optionally enabled or configured.
46
47 **Processing Steps**
48
49 1. Unpack (Always Active) –
50 Automatically unpacks packed sensor data formats.
51 This stage is internal and cannot be configured.
52
53 2. Hot Pixel Correction –
54 Identifies and corrects defective pixels (hot pixels).
55
56 3. Binning –
57 Reduces resolution and improves signal-to-noise ratio by combining adjacent pixels.
58
59 4. Decimation –
60 Downscales the image by skipping pixels in a defined pattern.
61
62 5. Mirror –
63 Optionally mirrors the image left-right and/or up-down.
64
65 6. Rotation –
66 Rotates the image by 90, 180, or 270 degrees.
67
68 7. Gain –
69 Applies digital master gain to control image brightness,
70 or digital color gains to adjust white balance.
71
72 8. Debayer (Configured Internally) -
73 Converts Bayer pattern raw data to RGB format and
74 expands monochrome images to RGB when a color output format is requested.
75 This behavior is automatically determined based on the input and output pixel formats.
76
77 9. ColorCorrection –
78 Applies a color correction matrix, saturation and chromatic adaption.
79
80 10. Auto Features –
81 Analyzes the image for the following dynamic adjustments:
82
83 - Auto Brightness
84 - Auto White Balance
85 - Auto Focus (if supported by the device)
86
87 To enable Auto Features, an external module must be provided via::
88
89 auto_feature_module = AutoFeatureModule(remote_device_node_map)
90 pipeline.auto_feature_module = auto_feature_module
91
92 This module is part of the **Auto Feature Library (AFL)**.
93
94 11. Mono conversion (Configured Internally) –
95 Converts RGB images to monochrome when a monochrome output format is requested.
96
97 12. Sharpening –
98 Enhances image detail using edge-based sharpening filters.
99
100 13. Gamma –
101 Applies gamma correction to adjust brightness and contrast.
102
103 14. Pixel Format Conversion (Configured Internally) –
104 Converts the processed image to the desired output pixel format.
105
106 **Smart Pixel Format Configuration Inference**
107
108 The pipeline includes built-in logic to automatically configure certain internal stages based on the input and
109 output formats. For example:
110
111 - If a Bayer image is provided and the output format is RGB, debayering is automatically applied.
112 - If a monochrome image is input and the output format is RGB, the DebayerModule takes over the mono-to-RGB expansion.
113 - If the output format is monochrome, mono conversion is enabled.
114 - If a Bayer pixel format is set as output format, the following features or modules are not processing:
115
116 - DebayerModule,
117 - MonoConversionModule,
118 - SharpeningFeature and
119 - GammaFeature.
120
121 - The PixelFormatConversionModule is responsible
122 for converting to the specified output format.
123 If necessary, the bit depth is reduced during this step.
124
125 Use the following method to set the desired final pixel format::
126
127 pipeline.output_pixel_format = PixelFormat.RGB_8
128
129 @note There might be cases where some modules, even though they are enabled,
130 do not apply their configuration, if the pixel format is not supported.
131 Further information can be found in the documentation of the individual
132 "process" methods for each module.
133
134 **Configuration**
135
136 The pipeline can be configured in two ways:
137
138 Module Access: Each configurable processing module can be accessed directly,
139 allowing individual configuration::
140
141 pipeline.gain.master = 1.2
142 pipeline.gamma.value = 2.2
143
144 Settings File: Load or save all configuration settings::
145
146 pipeline.import_settings_from_file("config.json")
147 pipeline.export_settings_to_file("config.json")
148
149 This modular and extensible design enables flexible integration into a variety
150 of image processing applications, from camera pipelines to offline image editing.
151
152 @since ids_peak_icv 1.0
153 @ingroup ids_peak_icv_python_pipeline
154 """
155
156 def __init__(self) -> None:
157 """!
158 @brief
159 Initializes all internal modules to their default configuration.
160
161 @since ids_peak_icv 1.0
162 """
163 self._processing_policy: ProcessingPolicy = ProcessingPolicy.BALANCED
166 self._binning_module = DownsamplingModule(DownsamplingMode.BinningAverage, "Binning")
167 self._decimation_module = DownsamplingModule(DownsamplingMode.Decimation, "Decimation")
169 mono_conversion_module = MonoConversionModule()
170 mono_conversion_module.enabled = False
171 self._mono_conversion_module = mono_conversion_module
173
178
189
193
194 self._auto_feature_module: None | IAutoFeature = None
195
196 @property
197 def version(self) -> int:
198 """!
199 @brief
200 The pipeline version as an integer.
201
202 @since ids_peak_icv 1.0
203 """
204 return 1
205
206 @property
207 def type(self) -> str:
208 """!
209 @brief
210 The pipeline type identifier as a string, primarily used for serialization.
211
212 @since ids_peak_icv 1.0
213 """
214 return "DefaultPipeline"
215
216 def process(self, image: Union[Image, IImageView]) -> Image:
217 """!
218 @brief
219 Applies the pipeline to the given image and returns the result as a new image.
220
221 The returned image is always a new instance.
222 If no processing is applied, it will be a deep copy of the input.
223
224 @warning The input image may be modified during execution due to in-place operations.
225 If you need to preserve the original image,
226 create a copy before calling this function.
227
228 @note This operation disregards any specified image regions
229 and processes the entire image.
230
231 @param image: Input image to be processed.
232
233 @return A new image containing the processed input or a deep copy of the input.
234
235 @since ids_peak_icv 1.0
236 """
237 if isinstance(image, IImageView):
238 result = cast(Image, super().process(Image.create_from_image_view(image)))
239 else:
240 result = cast(Image, super().process(image))
241
242 result = DefaultPipeline._copy_image_buffer_if_same_buffer(image, result)
243
244 return result
245
246 @staticmethod
247 def _copy_image_buffer_if_same_buffer(original_image: Image | IImageView, processed_image: Image) -> Image:
248 input_data = original_image.to_numpy_array(copy=False)
249 input_address = input_data.ctypes.data
250
251 output_data = processed_image.to_numpy_array(copy=False)
252 output_address = output_data.ctypes.data
253 if input_address == output_address:
254 return processed_image.convert_pixel_format(processed_image.pixel_format)
255
256 return cast(Image, processed_image)
257
259 """!
260 @brief
261 Converts the current pipeline settings into a string format.
262
263 Serializes all relevant configuration parameters of the pipeline into
264 a single string, which can be stored or transferred for later use.
265
266 The export includes:
267 - Pipeline version
268 - Pipeline type
269 - Creation timestamp (ISO UTC)
270 - All module settings (type + serialized data)
271
272 @return A string representation of the pipeline's current configuration state.
273
274 @since ids_peak_icv 1.0
275 """
276 from datetime import datetime, timezone
277
278 archive = Archive({
279 "Version": self.versionversion,
280 "Type": self.type,
281 "Creation": datetime.now(timezone.utc).isoformat()
282 })
283
284 modules = []
285
287 data_archive = Archive()
288 module.serialize(data_archive)
289 module_archive = Archive({
290 "Type": module.type,
291 "Data": data_archive
292 })
293 modules.append(module_archive)
294
295 archive.set("Modules", cast(list[IArchive], modules))
296
297 serializer = Serializer()
298 buffer = StringIO()
299 serializer.write(archive, buffer)
300
301 return buffer.getvalue()
302
303 def import_settings_from_string(self, settings: str) -> None:
304 """!
305 @brief
306 Restores pipeline settings from a previously serialized string.
307
308 Parses the provided string and applies the contained configuration values
309 to update the internal state of the pipeline accordingly.
310
311 This includes:
312 - Validation of version (must be >= 1).
313 - Validation of pipeline type (must match this pipeline).
314 - Restoring each module's settings by invoking its `deserialize` method.
315
316 @param settings: A string containing the serialized pipeline configuration.
317
318 @exception NotPossibleException: If the type is invalid.
319 @exception NotSupportedException: If the version is invalid.
320 @exception CorruptedException: If required module settings are missing.
321
322 @since ids_peak_icv 1.0
323 """
324
325 deserializer = Deserializer()
326
327 buffer = StringIO(settings)
328 archive = deserializer.read(buffer)
329
330 pipeline_type = archive.get("Type", str)
331 if pipeline_type != self.type:
333 f"The settings for {pipeline_type} are not compatible with this pipeline ({self.type})."
334 )
335
336 version = archive.get("Version", int)
337 if version < self.versionversion:
339 "The given version in the settings exceeds the pipeline version. "
340 f"Given settings version: {version}, pipeline version: {self.version}. "
341 "The module version has to be >= the given pipeline settings version.")
342
343 module_archives = {m.get("Type", str): m.get_archive("Data") for m in archive.get("Modules", list)}
344
346 module_type = module.type
347 if module_type not in module_archives:
348 raise CorruptedException(
349 f"The settings for module '{module_type}' are missing!"
350 )
351 module.deserialize(module_archives[module_type])
352
353 def reset_to_default(self) -> None:
354 """!
355 @brief
356 Resets all modules in the pipeline to their default state.
357 Also resets their enabled state.
358
359 In addition, this also resets the pipelines internal properties to default:
360 - ProcessingPolicy to ProcessingPolicy.Fast
361
362 @since ids_peak_icv 1.0
363 """
365 module.reset_to_default()
366 module.enabled = True
367
368 for feature in self._features_features:
369 feature.reset_to_default()
370 feature.enabled = True
371
372 self._mono_conversion_module.enabled = False
373 self._processing_policy = ProcessingPolicy.FAST
374
375 @property
376 def processing_policy(self) -> ProcessingPolicy:
377 """!
378 @brief
379 The currently used processing policy.
380
381 @since ids_peak_icv 1.0
382 """
383 return self._processing_policy
384
385 @processing_policy.setter
386 def processing_policy(self, policy: ProcessingPolicy) -> None:
387 """!
388 @brief
389 Defines the processing policy for the pipeline.
390
391 This policy determines the trade-off between processing speed and
392 image quality throughout the entire pipeline.
393
394 - **Fast**: Prioritizes processing speed, which may reduce image quality.
395 - **Balanced**: Balances processing speed and image quality for typical use cases.
396 - **Enhanced**: Prioritizes improved image quality at the cost of reduced processing speed.
397
398 @param policy: Desired processing policy.
399
400 @since ids_peak_icv 1.0
401 """
402 self._processing_policy = policy
403 self._unpack_module.processing_policy = policy
404 self._debayer_module.processing_policy = policy
405
406 @property
407 def output_pixel_format(self) -> PixelFormat:
408 """!
409 @brief
410 The current output pixel format as a `PixelFormat` enum.
411
412 @since ids_peak_icv 1.0
413 """
414 return self._final_conversion_module.output_pixel_format
415
416 @output_pixel_format.setter
417 def output_pixel_format(self, output_pixel_format: PixelFormat) -> None:
418 """!
419 @brief
420 Defines the desired pixel format for processed images.
421
422 The pipeline will convert images to this format during processing.
423
424 @warning
425 When set to a Bayer format,
426 the *ColorCorrection*, *Gamma* and *Sharpening* features
427 will not process the image because they do not support Bayer formats.
428 This may result in unexpected image quality if these features are enabled.
429
430 @param output_pixel_format: The new pixel format as a `PixelFormat` enum.
431
432 @since ids_peak_icv 1.0
433 """
434 is_bayer_format = output_pixel_format.is_single_channel and output_pixel_format.has_channel(Channel.BAYER)
435 is_mono_format = output_pixel_format.is_single_channel and output_pixel_format.has_intensity_channel
436
437 if is_bayer_format:
438 self._debayer_module.conversion_policy = DebayerConversionPolicy.BYPASS
439
440 elif is_mono_format:
441 self._debayer_module.conversion_policy = DebayerConversionPolicy.BAYER_ONLY
442 self._debayer_module.channel_layout = DebayerChannelLayout.RGB
443
444 else:
445 self._debayer_module.conversion_policy = DebayerConversionPolicy.BAYER_AND_MONO
446
447 if self._has_rgb_channels(output_pixel_format):
448 self._debayer_module.conversion_policy = DebayerConversionPolicy.BAYER_AND_MONO
450 output_pixel_format)
451
452 self._mono_conversion_module.enabled = is_mono_format
453 self._final_conversion_module.output_pixel_format = output_pixel_format
454
455 bit_depth = output_pixel_format.storage_bits_per_channel
456
457 self._unpack_module.processing_policy = self._processing_policy
458 self._unpack_module.target_bit_depth = bit_depth
459
460 self._debayer_module.processing_policy = self._processing_policy
461 self._debayer_module.target_bit_depth = bit_depth
462
463 # ------------------------------------------------------------------------------------------------------------------
464 # Features
465 # ------------------------------------------------------------------------------------------------------------------
466
467 @property
468 def mirror(self) -> MirrorFeature:
469 """!
470 @brief
471 Provides access to the mirror feature for image mirroring operations.
472
473 The mirror feature allows horizontal (left-right) and vertical (up-down) mirroring
474 of images during pipeline processing.
475
476 @return A reference to the mirror feature.
477
478 @since ids_peak_icv 1.0
479 """
480 return self._mirror_feature
481
482 @property
483 def rotation(self) -> RotationFeature:
484 """!
485 @brief
486 Provides access to the rotation feature for image rotation operations.
487
488 The rotation feature allows rotating images in 90-degree increments (0°, 90°, 180°, 270°)
489 during pipeline processing.
490
491 @return A reference to the rotation feature.
492
493 @since ids_peak_icv 1.0
494 """
495 return self._rotation_feature
496
497 @property
498 def gain(self) -> GainFeature:
499 """!
500 @brief
501 Provides access to the gain feature for brightness and white balance adjustments.
502
503 The gain feature allows adjustment of master gain (overall brightness) and individual
504 color channel gains (red, green, blue) for white balance correction.
505
506 @return A reference to the gain feature.
507
508 @since ids_peak_icv 1.0
509 """
510 return self._gain_feature
511
512 @property
513 def color_correction(self) -> ColorCorrectionFeature:
514 """!
515 @brief
516 Provides access to the color correction feature for color space transformations.
517
518 The color correction feature applies a 3x3 transformation matrix to perform color
519 balancing.
520
521 @return A reference to the color correction feature.
522
523 @since ids_peak_icv 1.0
524 """
525 return self._color_correction_feature
526
527 @property
528 def saturation(self) -> SaturationFeature:
529 """!
530 @brief
531 Provides access to the saturation feature for color intensity adjustments.
532
533 The saturation feature allows adjustment of color saturation levels, making colors
534 more vivid (higher saturation) or more muted (lower saturation).
535
536 @return A reference to the saturation feature.
537
538 @since ids_peak_icv 1.0
539 """
540 return self._saturation_feature
541
542 @property
543 def gamma(self) -> GammaFeature:
544 """!
545 @brief
546 Provides access to the gamma feature for brightness and contrast adjustments.
547
548 The gamma feature applies inverse gamma correction to adjust image luminance,
549 preparing images for linear domain processing or display.
550
551 @return A reference to the gamma feature.
552
553 @since ids_peak_icv 1.0
554 """
555 return self._gamma_feature
556
557 @property
558 def digital_black(self) -> DigitalBlackFeature:
559 """!
560 @brief
561 Provides access to the digital black feature for sensor offset correction.
562
563 The digital black feature compensates for sensor digital black offsets by subtracting
564 a configurable black level and normalizing the result.
565
566 @return A reference to the digital black feature.
567
568 @since ids_peak_icv 1.0
569 """
570 return self._digital_black_feature
571
572 @property
573 def sharpening(self) -> SharpeningFeature:
574 """!
575 @brief
576 Provides access to the sharpening feature for image detail enhancement.
577
578 The sharpening feature applies edge-based sharpening filters to enhance image detail
579 and improve perceived image sharpness.
580
581 @return A reference to the sharpening feature.
582
583 @since ids_peak_icv 1.0
584 """
585 return self._sharpening_feature
586
587 @property
588 def hotpixel_correction(self) -> HotpixelCorrectionFeature:
589 """!
590 @brief
591 Provides access to the hot pixel correction feature for defective pixel repair.
592
593 The hot pixel correction feature identifies and corrects defective pixels (hot pixels)
594 in camera images by replacing them with interpolated values from neighboring pixels.
595
596 @return A reference to the hotpixel correction feature.
597
598 @since ids_peak_icv 1.0
599 """
601
602 @property
603 def binning(self) -> BinningFeature:
604 """!
605 @brief
606 Provides access to the binning feature for resolution reduction and noise improvement.
607
608 The binning feature reduces image resolution by combining adjacent pixels through
609 averaging or summation, improving signal-to-noise ratio at the cost of resolution.
610
611 @return A reference to the BinningFeature.
612
613 @since ids_peak_icv 1.0
614 """
615 return self._binning_feature
616
617 @property
618 def decimation(self) -> DecimationFeature:
619 """!
620 @brief
621 Provides access to the decimation feature for resolution reduction by pixel skipping.
622
623 The decimation feature reduces image resolution by skipping pixels in a defined pattern,
624 providing a faster alternative to binning for resolution reduction.
625
626 A reference to the DecimationFeature.
627
628 @return A reference to the DecimationFeature.
629
630 @since ids_peak_icv 1.0
631 """
632 return self._decimation_feature
633
634 @property
635 def chromatic_adaption(self) -> ChromaticAdaptionFeature:
636 """!
637 @brief
638 Provides access to the chromatic adaption feature for adjusting to lighting conditions.
639
640 The chromatic adaption feature adjusts the image's colors based on the known or estimated
641 correlated color temperature of the light source, maintaining consistent color perception.
642
643 @return A reference to the chromatic adaption feature.
644
645 @since ids_peak_icv 1.3
646 """
648
649 # ------------------------------------------------------------------------------------------------------------------
650 # Auto Features
651 # ------------------------------------------------------------------------------------------------------------------
652
653 @property
654 def autofeature_module(self) -> IAutoFeature | None:
655 """!
656 @brief
657 The used auto feature module.
658 """
659 return self._auto_feature_module
660
661 @autofeature_module.setter
662 def autofeature_module(self, auto_feature_module: IAutoFeature | None) -> None:
663 """!
664 @brief
665 Sets an auto feature module for automatic image adjustments.
666
667 These adjustments can include features such as
668 image brightness, white balance, and focus,
669 depending on the capabilities of the provided module.
670
671 @note
672 If there is no auto feature module specified,
673 this step will be skipped during processing.
674
675 @param auto_feature_module: The auto feature module.
676 """
677 if self._auto_feature_module:
678 self._auto_feature_module.set_gain_module(None)
679 self._auto_feature_module = auto_feature_module
680 self._color_matrix_transformation_module._set_autofeature_module(auto_feature_module)
681 if self._auto_feature_module:
682 self._auto_feature_module.set_gain_module(self._gain_module)
683
684 # ------------------------------------------------------------------------------------------------------------------
685 # Internal
686 # ------------------------------------------------------------------------------------------------------------------
687
688 @property
689 def _modules(self) -> tuple[IModule, ...]:
690 """!
691 @brief
692 Retrieves the sequence of processing modules for the pipeline in execution order.
693
694 @return Sequence of pipeline modules.
695
696 @since ids_peak_icv 1.0
697 """
698
702 (self._auto_feature_module,) if self._auto_feature_module is not None else ()
705
706 @property
713 def _channel_layout_from_output_pixelformat(self, output_pixel_format: PixelFormat) -> DebayerChannelLayout:
714 if output_pixel_format in [PixelFormat.RGB_8, PixelFormat.RGB_10, PixelFormat.RGB_12,
715 PixelFormat.RGB_10_PACKED_32]:
716 return DebayerChannelLayout.RGB
717
718 if output_pixel_format in [PixelFormat.RGBA_8, PixelFormat.RGBA_10, PixelFormat.RGBA_12]:
719 return DebayerChannelLayout.RGBA
720
721 if output_pixel_format in [PixelFormat.BGR_8, PixelFormat.BGR_10, PixelFormat.BGR_12,
722 PixelFormat.BGR_10_PACKED_32]:
723 return DebayerChannelLayout.BGR
724
725 if output_pixel_format in [PixelFormat.BGRA_8, PixelFormat.BGRA_10, PixelFormat.BGRA_12]:
726 return DebayerChannelLayout.BGRA
727
729 f"There is not conversion to a debayer channel layout implemented for the given pixel format. "
730 f"Given pixel format: {output_pixel_format}")
731
732 def _has_rgb_channels(self, pixel_format: PixelFormat) -> bool:
733 return (pixel_format.has_channel(Channel.RED) and
734 pixel_format.has_channel(Channel.GREEN) and
735 pixel_format.has_channel(Channel.BLUE))
Occurs when reading from a file or stream that is incomplete, damaged, or in an unexpected format.
Occurs when a failure happens during processing due to an unhandled internal routine condition.
Definition exceptions.py:33
Occurs when an operation cannot be performed due to logical constraints (e.g., camera calibration wit...
Definition exceptions.py:72
Occurs when a requested operation is not implemented or supported (e.g., exporting to an unsupported ...
Definition exceptions.py:60
Color matrix transformation is an image pipeline module that applies a color correction matrix to an ...
Debayer is an image pipeline module that converts Bayer RAW images into standard color formats.
Gain is an image pipeline module that applies gain correction to an image.
Hotpixel correction is an image pipeline module for detecting and correcting hot pixels in camera ima...
Mono conversion is an image pipeline module that converts images to a monochrome format.
Pixel format conversion module that transforms images to a specified output pixel format.
Sharpening is an image pipeline module that applies a sharpening filter to enhance image detail.
A pipeline module for applying tone curve corrections such as gamma adjustment and digital black offs...
Transformation is an image pipeline module that provides mirror and rotation functionality.
Unpack is an image pipeline module that converts packed pixel formats into corresponding unpacked Bay...
Image processing pipeline for sequential transformation of raw image frames.
int version(self)
The pipeline version as an integer.
None reset_to_default(self)
Resets all modules in the pipeline to their default state.
bool _has_rgb_channels(self, PixelFormat pixel_format)
DigitalBlackFeature digital_black(self)
Provides access to the digital black feature for sensor offset correction.
ColorCorrectionFeature color_correction(self)
Provides access to the color correction feature for color space transformations.
IAutoFeature|None autofeature_module(self)
The used auto feature module.
None import_settings_from_string(self, str settings)
Restores pipeline settings from a previously serialized string.
Image _copy_image_buffer_if_same_buffer(Image|IImageView original_image, Image processed_image)
GammaFeature gamma(self)
Provides access to the gamma feature for brightness and contrast adjustments.
str type(self)
The pipeline type identifier as a string, primarily used for serialization.
BinningFeature binning(self)
Provides access to the binning feature for resolution reduction and noise improvement.
tuple[IModule,...] _modules(self)
Retrieves the sequence of processing modules for the pipeline in execution order.
SaturationFeature saturation(self)
Provides access to the saturation feature for color intensity adjustments.
ChromaticAdaptionFeature chromatic_adaption(self)
Provides access to the chromatic adaption feature for adjusting to lighting conditions.
str export_settings_to_string(self)
Converts the current pipeline settings into a string format.
PixelFormat output_pixel_format(self)
The current output pixel format as a PixelFormat enum.
Image process(self, Union[Image, IImageView] image)
Applies the pipeline to the given image and returns the result as a new image.
None __init__(self)
Initializes all internal modules to their default configuration.
DebayerChannelLayout _channel_layout_from_output_pixelformat(self, PixelFormat output_pixel_format)
SharpeningFeature sharpening(self)
Provides access to the sharpening feature for image detail enhancement.
DecimationFeature decimation(self)
Provides access to the decimation feature for resolution reduction by pixel skipping.
HotpixelCorrectionFeature hotpixel_correction(self)
Provides access to the hot pixel correction feature for defective pixel repair.
RotationFeature rotation(self)
Provides access to the rotation feature for image rotation operations.
MirrorFeature mirror(self)
Provides access to the mirror feature for image mirroring operations.
GainFeature gain(self)
Provides access to the gain feature for brightness and white balance adjustments.
Adjusts to changes in lighting conditions to maintain consistent color perception despite variations ...
Color correction applies a 3x3 color correction matrix to the image.
Digital black applies digital black correction to an image.
Gain is an image pipeline feature that applies gain correction to an image.
Gamma applies an inverse gamma transformation to an image.
HotpixelCorrection detects and corrects hot pixels in camera images.
Mirror provides functionality to flip the image left-right or up-down.
Rotation provides fixed-angle rotation functionality.
Adjusts the saturation of an image by modifying a 3x3 color correction matrix.
Provides access to sharpening settings within an image processing pipeline.
A key-value store with type checking, based on a dict.
Definition archive.py:11
Deserializer for reading serialized data and converting it into an IArchive object.
Serializer for writing IArchive objects to an output stream.
Definition serializer.py:12