IDS peak ICV v1.1.0
Loading...
Searching...
No Matches
HotpixelCorrectionModule Class Reference
Inheritance diagram for HotpixelCorrectionModule:

Public Member Functions

None __init__ (self)
 Creates a HotpixelCorrectionModule module with default settings (no correction).
 
str type (self)
 Returns the type of the module for serialization purposes.
 
bool enabled (self)
 Gets whether this module is enabled.
 
None enabled (self, bool enabled)
 Enable or disable the module.
 
PointArray hotpixel_list (self)
 Gets the current array of known hot pixels.
 
None hotpixel_list (self, PointArray pixel_list)
 Sets the array of known hot pixels.
 
Interval sensitivity_range (self)
 Gets the valid range for sensitivity.
 
None detect (self, Image image, int sensitivity=3, float gain_factor=1.0)
 Performs immediate hot pixel detection on the given image.
 
Image process (self, Image input_image)
 Applies hot pixel correction to the input image in place and returns a reference to the modified image.
 
None reset_to_default (self)
 Resets all module settings.
 
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.
 

Data Fields

 enabled
 
 hotpixel_list = []
 

Static Public Attributes

np DEFAULT_HOTPIXEL_LIST = np.empty(0, dtype=Point)
 

Protected Member Functions

None _apply_pixel_list (self)
 
None _call_backend_set_list (self, npt.NDArray pixel_list)
 
None _call_backend_get_list (self)
 

Protected Attributes

bool _hotpixel_correction_enabled = True
 
np.ndarray|None _hotpixel_list = self.DEFAULT_HOTPIXEL_LIST
 
 _handle = _hotpixel_correction_handle
 
np _hotpixel_list
 
 _enabled
 

Detailed Description

Hotpixel correction is an image pipeline module for detecting and correcting hot pixels in camera images.

Provides the feature HotpixelCorrectionFeature.

Since
ids_peak_icv 1.0

Definition at line 23 of file hotpixel_correction_module.py.

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self)

Creates a HotpixelCorrectionModule module with default settings (no correction).

Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

Definition at line 41 of file hotpixel_correction_module.py.

Member Function Documentation

◆ _apply_pixel_list()

None _apply_pixel_list ( self)
protected

Definition at line 285 of file hotpixel_correction_module.py.

◆ _call_backend_get_list()

None _call_backend_get_list ( self)
protected

Definition at line 306 of file hotpixel_correction_module.py.

◆ _call_backend_set_list()

None _call_backend_set_list ( self,
npt.NDArray pixel_list )
protected

Definition at line 294 of file hotpixel_correction_module.py.

◆ deserialize()

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.

Parameters
archiveThe source archive containing the serialized parameters.
Exceptions
CorruptedExceptionIf Archive is malformed, misses keys or the values are invalid
NotSupportedExceptionIf the 'Version' entry indicates an unsupported version.
Note
This function requires that the archive contains all expected fields as produced by a corresponding serialize() call.
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

Definition at line 256 of file hotpixel_correction_module.py.

◆ detect()

None detect ( self,
Image image,
int sensitivity = 3,
float gain_factor = 1.0 )

Performs immediate hot pixel detection on the given image.

This method analyzes the provided image and detects hot pixels based on the sensitivity setting. The results are stored internally and can be accessed using pixel_list.

Note: Calling this function will overwrite any existing hot pixel list previously set via pixel_list.

Parameters
imageThe input image to analyze for hot pixel detection.
sensitivitySensitivity for hot pixel detection. A higher sensitivity may result in detecting more hot pixels, including possible false positives.
gain_factorGain factor applied to the image. Used to account for increased noise levels when detecting hot pixels.
Exceptions
NotSupportedExceptionIf image has any other than the supported pixel formats.
Since
ids_peak_icv 1.0

Definition at line 153 of file hotpixel_correction_module.py.

◆ enabled() [1/2]

bool enabled ( self)

Gets whether this module is enabled.

When disabled, :func:process returns the input image unchanged.

Returns
True if the module is enabled, False otherwise.
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

Definition at line 73 of file hotpixel_correction_module.py.

◆ enabled() [2/2]

None enabled ( self,
bool enabled )

Enable or disable the module.

When disabled, :func:process returns the input image unchanged.

Parameters
enabledTrue to enable, False to disable.
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

Definition at line 87 of file hotpixel_correction_module.py.

◆ hotpixel_list() [1/2]

PointArray hotpixel_list ( self)

Gets the current array of known hot pixels.

Returns
An array containing the positions of all configured hot pixels.
Since
ids_peak_icv 1.0

Definition at line 102 of file hotpixel_correction_module.py.

◆ hotpixel_list() [2/2]

None hotpixel_list ( self,
PointArray pixel_list )

Sets the array of known hot pixels.

Parameters
pixel_listAn array of hot pixel positions to use.
Since
ids_peak_icv 1.0

Definition at line 119 of file hotpixel_correction_module.py.

◆ process()

Image process ( self,
Image input_image )

Applies hot pixel correction to the input image in place and returns a reference to the modified image.

Supported pixel formats
  • Mono8
  • Mono10
  • Mono12
  • BayerBG8
  • BayerBG10
  • BayerBG12
  • BayerGB8
  • BayerGB10
  • BayerGB12
  • BayerRG8
  • BayerRG10
  • BayerRG12
  • BayerGR8
  • BayerGR10
  • BayerGR12

See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.

The correction is performed based on the current configuration of the module. The operation modifies the input image directly and does not create a copy.

Supported pixel formats
  • Mono8
  • Mono10
  • Mono12
  • BayerBG8
  • BayerBG10
  • BayerBG12
  • BayerGB8
  • BayerGB10
  • BayerGB12
  • BayerRG8
  • BayerRG10
  • BayerRG12
  • BayerGR8
  • BayerGR10
  • BayerGR12

See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.

Images with other formats are passed through unmodified.

This operation disregards any specified image regions and processes the entire image.

Parameters
input_imageThe input image to be processed and corrected.
Exceptions
NotSupportedExceptionIf image has any other than the supported pixel formats.
Returns
A new image with hotpixel correction applied.
Since
ids_peak_icv 1.0

Reimplemented from IModule.

Definition at line 179 of file hotpixel_correction_module.py.

◆ reset_to_default()

None reset_to_default ( self)

Resets all module settings.

Restores the module configuration to its default values:

  • hotpixel_list = empty np.ndarray of type Point
Since
ids_peak_icv 1.0

Reimplemented from IModule.

Definition at line 215 of file hotpixel_correction_module.py.

◆ sensitivity_range()

Interval sensitivity_range ( self)

Gets the valid range for sensitivity.

Returns
The valid sensitivity range.
Since
ids_peak_icv 1.0

Definition at line 138 of file hotpixel_correction_module.py.

◆ serialize()

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.

Returns
The serialized module's internal state.
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

Definition at line 230 of file hotpixel_correction_module.py.

◆ type()

str type ( self)

Returns the type of the module for serialization purposes.

Returns
Module type.
Since
ids_peak_icv 1.0

Reimplemented from IModule.

Definition at line 61 of file hotpixel_correction_module.py.

Field Documentation

◆ _enabled

_enabled
protected

Definition at line 246 of file hotpixel_correction_module.py.

◆ _handle

_handle = _hotpixel_correction_handle
protected

Definition at line 58 of file hotpixel_correction_module.py.

◆ _hotpixel_correction_enabled

bool _hotpixel_correction_enabled = True
protected

Definition at line 50 of file hotpixel_correction_module.py.

◆ _hotpixel_list [1/2]

_hotpixel_list = self.DEFAULT_HOTPIXEL_LIST
protected

Definition at line 51 of file hotpixel_correction_module.py.

◆ _hotpixel_list [2/2]

np _hotpixel_list
protected

Definition at line 116 of file hotpixel_correction_module.py.

◆ DEFAULT_HOTPIXEL_LIST

np DEFAULT_HOTPIXEL_LIST = np.empty(0, dtype=Point)
static

Definition at line 33 of file hotpixel_correction_module.py.

◆ enabled

enabled

Definition at line 203 of file hotpixel_correction_module.py.

◆ hotpixel_list

hotpixel_list = []

Definition at line 249 of file hotpixel_correction_module.py.