IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
DefaultPipeline Class Reference
Inheritance diagram for DefaultPipeline:

Public Member Functions

 DefaultPipeline ()
 Creates a DefaultPipeline with default module settings.
 
void Dispose ()
 Releases all resources used by the DefaultPipeline.
 
override string ExportSettingsToString ()
 Converts the current pipeline settings into a string format.
 
override void ImportSettingsFromString (string settings)
 Restores pipeline settings from a previously serialized string.
 
override void ResetToDefault ()
 Resets all modules in the pipeline to their default state. Also resets their enabled state.
 
Image Process (Image image)
 Applies the pipeline to the given image and returns the result as a new image.
 
override object Process (object input)
 Applies the pipeline to the given image and returns the result as a new image.
 
Image Process (IImageView imageView)
 Applies the pipeline to an image view and returns the result as a new image.
 
void ReleaseBuffers ()
 Frees unused internal buffers.
 
virtual void ExportSettingsToFile (string filePath)
 Saves the current settings of the pipeline and its modules to a file.
 
virtual void ImportSettingsFromFile (string filePath)
 Loads the settings of the pipeline and its modules from a file.
 

Properties

override string TypeId [get]
 The pipeline type identifier as a string, primarily used for serialization.
 
ProcessingPolicy ProcessingPolicy [get, set]
 Defines the processing policy for the pipeline.
 
PixelFormat OutputPixelFormat [get, set]
 The current output pixel format as a PixelFormat enum.
 
HotpixelCorrectionFeature Hotpixel [get]
 Provides access to the hot pixel correction feature for defective pixel repair.
 
BinningFeature Binning [get]
 Provides access to the binning feature for resolution reduction and noise improvement.
 
DecimationFeature Decimation [get]
 Provides access to the decimation feature for resolution reduction by pixel skipping.
 
MirrorFeature Mirror [get]
 Provides access to the mirror feature for image mirroring operations.
 
RotationFeature Rotation [get]
 Provides access to the rotation feature for image rotation operations.
 
GainFeature Gain [get]
 Provides access to the gain feature for brightness and white balance adjustments.
 
ColorCorrectionFeature ColorCorrection [get]
 Provides access to the color correction feature for color space transformations.
 
SaturationFeature Saturation [get]
 Provides access to the saturation feature for color intensity adjustments.
 
ChromaticAdaptionFeature ChromaticAdaption [get]
 Provides access to the chromatic adaption feature for adjusting to lighting conditions.
 
SharpeningFeature Sharpening [get]
 Provides access to the sharpening feature for image detail enhancement.
 
GammaFeature Gamma [get]
 Provides access to the gamma feature for brightness and contrast adjustments.
 
DigitalBlackFeature DigitalBlack [get]
 Provides access to the digital black feature for sensor offset correction.
 
IAutoFeature? AutoFeatureModule [get, set]
 Auto feature module for automatic image adjustments.
 

Detailed Description

Image processing pipeline for sequential transformation of raw image frames.

The Pipeline class performs a series of configurable image processing steps on raw or pre-processed image data. It is designed to support a complete transformation workflow, from raw sensor input to final output format, with each stage modular and optionally enabled or configured.

Processing Steps:

  1. Unpack (Always Active) – Automatically unpacks packed sensor data formats. This stage is internal and cannot be configured.
  2. Hot Pixel Correction – Identifies and corrects defective pixels (hot pixels).
  3. Binning – Reduces resolution and improves signal-to-noise ratio by combining adjacent pixels.
  4. Decimation – Downscales the image by skipping pixels in a defined pattern.
  5. Mirror – Optionally mirrors the image left-right and/or up-down.
  6. Rotation – Rotates the image by 90, 180, or 270 degrees.
  7. Gain – Applies digital master gain to control image brightness, or digital color gains to adjust white balance.
  8. Debayer (Configured Internally) - Converts Bayer pattern raw data to RGB format and expands monochrome images to RGB when a color output format is requested. This behavior is automatically determined based on the input and output pixel formats.
  9. ColorCorrection – Applies a color correction matrix.
  10. Auto Features – Analyzes the image for the following dynamic adjustments:
    • Auto Brightness
    • Auto White Balance
    • Auto Focus (if supported by the device)
    To enable Auto Features, an external module must be provided via:
    using var autoFeature = new BasicAutoFeatures(device);
    pipeline.AutoFeatureModule = autoFeature;
    This module is part of the Auto Feature Library (AFL).
  11. Mono conversion (Configured Internally) – Converts RGB images to monochrome when a monochrome output format is requested.
  12. Sharpening – Enhances image detail using edge-based sharpening filters.
  13. Gamma – Applies gamma correction to adjust brightness and contrast.
  14. Pixel Format Conversion (Configured Internally) – Converts the processed image to the desired output pixel format.

Smart Pixel Format Configuration Inference

The pipeline includes built-in logic to automatically configure certain internal stages based on the input and output formats. For example:

  • If a Bayer image is provided and the output format is RGB, debayering is automatically applied.
  • If a monochrome image is input and the output format is RGB, the DebayerModule takes over the mono-to-RGB expansion.
  • If the output format is monochrome, mono conversion is enabled.
  • If a Bayer pixel format is set as output format, the following features or modules are not processing:
    • DebayerModule,
    • MonoConversionModule,
    • SharpeningFeature and
    • GammaFeature.
  • The PixelFormatConversionModule is responsible for converting to the specified output format. If necessary, the bit depth is reduced during this step.

Use the following method to set the desired final pixel format:

Note
There might be cases where some modules, even though they are enabled, do not apply their configuration, if the pixel format is not supported. Further information can be found in the documentation of the individual "Process" methods for each module.

Configuration

The pipeline can be configured in two ways:

  • Module Access: Each configurable processing module can be accessed directly, allowing individual configuration:
    pipeline.Gain.Master = 1.2;
    pipeline.Gamma.Value = 2.2;
  • Settings File: Load or save all configuration settings:
    pipeline.ImportSettingsFromFile("config.json");
    pipeline.ExportSettingsToFile("config.json");

This modular and extensible design enables flexible integration into a variety of image processing applications, from camera pipelines to offline image editing.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 197 of file DefaultPipeline.cs.

Constructor & Destructor Documentation

◆ DefaultPipeline()

DefaultPipeline ( )
inline

Creates a DefaultPipeline with default module settings.

Initializes all internal modules to their default configuration.

Definition at line 225 of file DefaultPipeline.cs.

Member Function Documentation

◆ Dispose()

void Dispose ( )
inline

Releases all resources used by the DefaultPipeline.

Definition at line 434 of file DefaultPipeline.cs.

◆ ExportSettingsToFile()

virtual void ExportSettingsToFile ( string filePath)
inlinevirtualinherited

Saves the current settings of the pipeline and its modules to a file.

This base implementation calls ExportSettingsToString and writes the resulting string to the specified filepath.

Parameters
filePathPath to the file where the settings should be saved.

Implements IPipeline.

Definition at line 36 of file PipelineBase.cs.

◆ ExportSettingsToString()

override string ExportSettingsToString ( )
inline

Converts the current pipeline settings into a string format.

Serializes all relevant configuration parameters of the pipeline into a single string, which can be stored or transferred for later use.

The export includes:

  • Pipeline version
  • Pipeline type
  • Creation timestamp (ISO UTC)
  • All module settings (type + serialized data)
Returns
A string representation of the pipeline's current configuration state.

Implements IPipeline.

Definition at line 547 of file DefaultPipeline.cs.

◆ ImportSettingsFromFile()

virtual void ImportSettingsFromFile ( string filePath)
inlinevirtualinherited

Loads the settings of the pipeline and its modules from a file.

This base implementation reads the file contents and passes them to ImportSettingsFromString to restore the pipeline state.

Parameters
filePathPath to the file from which settings should be loaded.

Implements IPipeline.

Definition at line 61 of file PipelineBase.cs.

◆ ImportSettingsFromString()

override void ImportSettingsFromString ( string settings)
inline

Restores pipeline settings from a previously serialized string.

Parses the provided string and applies the contained configuration values to update the internal state of the pipeline accordingly.

This includes:

  • Validation of version (must be >= 1).
  • Validation of pipeline type (must match this pipeline).
  • Restoring each module's settings by invoking its Deserialize method.
Parameters
settingsA string containing the serialized pipeline configuration.
Exceptions
IcvNotPossibleExceptionThe type is invalid.
IcvNotSupportedExceptionThe version is invalid.
IcvCorruptedExceptionThe required module settings are missing.

Implements IPipeline.

Definition at line 612 of file DefaultPipeline.cs.

◆ Process() [1/3]

Image Process ( IImageView imageView)
inline

Applies the pipeline to an image view and returns the result as a new image.

Internally, the image view is converted into an Image before processing.

The returned image is always a new instance. If no processing is applied, it will contain a deep copy of the input buffer.

Note
This operation disregards any specified image regions and processes the entire image.
Parameters
imageViewInput image view to be processed.
Returns
A new image containing the processed input or a deep copy of the input.

Definition at line 847 of file DefaultPipeline.cs.

◆ Process() [2/3]

Image Process ( Image image)
inline

Applies the pipeline to the given image and returns the result as a new image.

The returned image is always a new instance. If no processing is applied, it will be a deep copy of the input.

Warning
The input image may be modified during execution due to in-place operations. If you need to preserve the original image, create a copy before calling this function.
Note
This operation disregards any specified image regions and processes the entire image.
Parameters
imageInput image to be processed.
Returns
A new image containing the processed input or a deep copy of the input.

Definition at line 728 of file DefaultPipeline.cs.

◆ Process() [3/3]

override object Process ( object input)
inlinevirtual

Applies the pipeline to the given image and returns the result as a new image.

The returned image is always a new instance. If no processing is applied, it will be a deep copy of the input.

Note
This operation disregards any specified image regions and processes the entire image.
Parameters
inputInput image to be processed.
Returns
A new image containing the processed input or a deep copy of the input.

Reimplemented from PipelineBase.

Definition at line 814 of file DefaultPipeline.cs.

◆ ReleaseBuffers()

void ReleaseBuffers ( )
inline

Frees unused internal buffers.

Conversion modules use 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.

Warning
Avoid calling this function too frequently (e.g., after every resize or format change), as it introduces some overhead and may negatively impact performance.

Definition at line 869 of file DefaultPipeline.cs.

◆ ResetToDefault()

override void ResetToDefault ( )
inline

Resets all modules in the pipeline to their default state. Also resets their enabled state.

In addition, this also resets the pipelines internal properties to default:

  • ProcessingPolicy to ProcessingPolicy.Fast

Implements IPipeline.

Definition at line 679 of file DefaultPipeline.cs.

Property Documentation

◆ AutoFeatureModule

IAutoFeature? AutoFeatureModule
getset

Auto feature module for automatic image adjustments.

These adjustments can include features such as image brightness, white balance and focus, depending on the capabilities of the provided module.

Note
If there is no auto feature module specified, this step will be skipped during processing.

Definition at line 418 of file DefaultPipeline.cs.

◆ Binning

BinningFeature Binning
get

Provides access to the binning feature for resolution reduction and noise improvement.

The binning feature reduces image resolution by combining adjacent pixels through averaging or summation, improving signal-to-noise ratio at the cost of resolution.

Definition at line 316 of file DefaultPipeline.cs.

◆ ChromaticAdaption

ChromaticAdaptionFeature ChromaticAdaption
get

Provides access to the chromatic adaption feature for adjusting to lighting conditions.

The chromatic adaption feature adjusts the image's colors based on the known or estimated correlated color temperature of the light source, maintaining consistent color perception.

Definition at line 378 of file DefaultPipeline.cs.

◆ ColorCorrection

ColorCorrectionFeature ColorCorrection
get

Provides access to the color correction feature for color space transformations.

The color correction feature applies a 3x3 transformation matrix to perform color balancing.

Definition at line 360 of file DefaultPipeline.cs.

◆ Decimation

DecimationFeature Decimation
get

Provides access to the decimation feature for resolution reduction by pixel skipping.

The decimation feature reduces image resolution by skipping pixels in a defined pattern, providing a faster alternative to binning for resolution reduction.

Definition at line 325 of file DefaultPipeline.cs.

◆ DigitalBlack

DigitalBlackFeature DigitalBlack
get

Provides access to the digital black feature for sensor offset correction.

The digital black feature compensates for sensor digital black offsets by subtracting a configurable black level and normalizing the result.

Definition at line 405 of file DefaultPipeline.cs.

◆ Gain

GainFeature Gain
get

Provides access to the gain feature for brightness and white balance adjustments.

The gain feature allows adjustment of master gain (overall brightness) and individual color channel gains (red, green, blue) for white balance correction.

Definition at line 352 of file DefaultPipeline.cs.

◆ Gamma

GammaFeature Gamma
get

Provides access to the gamma feature for brightness and contrast adjustments.

The gamma feature applies inverse gamma correction to adjust image luminance, preparing images for linear domain processing or display.

Definition at line 396 of file DefaultPipeline.cs.

◆ Hotpixel

Provides access to the hot pixel correction feature for defective pixel repair.

The hot pixel correction feature identifies and corrects defective pixels (hot pixels) in camera images by replacing them with interpolated values from neighboring pixels.

Definition at line 307 of file DefaultPipeline.cs.

◆ Mirror

MirrorFeature Mirror
get

Provides access to the mirror feature for image mirroring operations.

The mirror feature allows horizontal (left-right) and vertical (up-down) mirroring of images during pipeline processing.

Definition at line 334 of file DefaultPipeline.cs.

◆ OutputPixelFormat

PixelFormat OutputPixelFormat
getset

The current output pixel format as a PixelFormat enum.

Definition at line 294 of file DefaultPipeline.cs.

◆ ProcessingPolicy

Defines the processing policy for the pipeline.

This policy determines the trade-off between processing speed and image quality throughout the entire pipeline.

  • Fast: Prioritizes processing speed, which may reduce image quality.
  • Balanced: Balances processing speed and image quality for typical use cases.
  • Enhanced: Prioritizes improved image quality at the cost of reduced processing speed.

Gets or sets the processing policy for the image processing pipeline.

Definition at line 285 of file DefaultPipeline.cs.

◆ Rotation

RotationFeature Rotation
get

Provides access to the rotation feature for image rotation operations.

The rotation feature allows rotating images in 90-degree increments (0°, 90°, 180°, 270°) during pipeline processing.

Definition at line 343 of file DefaultPipeline.cs.

◆ Saturation

SaturationFeature Saturation
get

Provides access to the saturation feature for color intensity adjustments.

The saturation feature allows adjustment of color saturation levels, making colors more vivid (higher saturation) or more muted (lower saturation).

Definition at line 369 of file DefaultPipeline.cs.

◆ Sharpening

SharpeningFeature Sharpening
get

Provides access to the sharpening feature for image detail enhancement.

The sharpening feature applies edge-based sharpening filters to enhance image detail and improve perceived image sharpness.

Definition at line 387 of file DefaultPipeline.cs.

◆ TypeId

override string TypeId
get

The pipeline type identifier as a string, primarily used for serialization.

Implements IPipeline.

Definition at line 261 of file DefaultPipeline.cs.