IDS peak IPL  v1.9.2
peak::ipl::HotpixelCorrection Class Referencefinal

Algorithm for (adaptive) hotpixel detection and correction. More...

#include <peak_ipl/algorithm/peak_ipl_hotpixel_correction.hpp>

Public Types

enum  SensitivityLevel {
  SensitivityLevel::Invalid,
  SensitivityLevel::SensitivityLevel1,
  SensitivityLevel::SensitivityLevel2,
  SensitivityLevel::SensitivityLevel3,
  SensitivityLevel::SensitivityLevel4,
  SensitivityLevel::SensitivityLevel5
}
 SensitivityLevel parameter for the HotpixelCorrection algorithm. More...
 

Public Member Functions

 HotpixelCorrection ()
 Constructor for a new HotpixelCorrection instance. More...
 
 ~HotpixelCorrection ()
 Destructor for the HotpixelCorrection instance. More...
 
 HotpixelCorrection (const HotpixelCorrection &other)
 Copy Constructor for a new HotpixelCorrection instance. More...
 
HotpixelCorrection & operator= (const HotpixelCorrection &other)
 Copy assigment for HotpixelCorrection instance. More...
 
 HotpixelCorrection (HotpixelCorrection &&other) noexcept
 Move constructor for HotpixelCorrection instance. More...
 
HotpixelCorrection & operator= (HotpixelCorrection &&other) noexcept
 Move assignment for HotpixelCorrection instance. More...
 
void SetSensitivity (SensitivityLevel sensitivityLevel=SensitivityLevel::SensitivityLevel3)
 Sets the sensitivity of the hotpixel detection. More...
 
void SetGainFactorPercent (uint32_t gainFactorPercent=100)
 Sets the gain factor in percent. More...
 
Image & CorrectInPlace (Image &inputImage, const std::vector< Point2D > &hotpixels) const
 Corrects the given hotpixels inplace in the given image. More...
 
Image & CorrectAdaptiveInPlace (Image &inputImage)
 Corrects the given image inplace adaptively. More...
 

Public Attributes

 PEAK_IPL_MAYBE_UNUSED = SensitivityLevel Sensitivity() const
 

Detailed Description

Algorithm for (adaptive) hotpixel detection and correction.

This algorithm corrects hotpixels either manually by correcting a predefined list of pixels or adaptively by automatically updating the list of pixels to correct. In manual mode, pass a list of hotpixels to Correct(). The hotpixels can be obtained using Detect(), or from a different source, e.g. retrieved directly from the camera from an initial hotpixel calibration. In adaptive mode, just keep passing new images to CorrectAdaptive(). Hotpixels are then detected and corrected automatically.

Member Enumeration Documentation

◆ SensitivityLevel

SensitivityLevel parameter for the HotpixelCorrection algorithm.

Higher sensitivity levels mean more hotpixels will be detected and corrected, but can also lead to more false-positives.

Enumerator
Invalid 
SensitivityLevel1 
SensitivityLevel2 
SensitivityLevel3 

default

SensitivityLevel4 
SensitivityLevel5 

Constructor & Destructor Documentation

◆ HotpixelCorrection() [1/3]

peak::ipl::HotpixelCorrection::HotpixelCorrection ( )
inline

Constructor for a new HotpixelCorrection instance.

Creates a new HotpixelCorrection instance.

Since
1.0

◆ ~HotpixelCorrection()

peak::ipl::HotpixelCorrection::~HotpixelCorrection ( )
inline

Destructor for the HotpixelCorrection instance.

Destroys a HotpixelCorrection instance.

Since
1.0

◆ HotpixelCorrection() [2/3]

peak::ipl::HotpixelCorrection::HotpixelCorrection ( const HotpixelCorrection &  other)
inline

Copy Constructor for a new HotpixelCorrection instance.

Creates a new HotpixelCorrection instance.

Note
This only creates a shallow copy. See Shallow copy (since 1.8) for a detailed explanation.
Parameters
[in]otherThe other instance to acquire a reference for.
Since
1.0 Deleted
1.8 Implemented as shallow copy

◆ HotpixelCorrection() [3/3]

peak::ipl::HotpixelCorrection::HotpixelCorrection ( HotpixelCorrection &&  other)
inlinenoexcept

Move constructor for HotpixelCorrection instance.

Moves the instance from other to this. Afterwards other is invalid.

Parameters
[in]otherThe other instance to move.
Since
1.0

Member Function Documentation

◆ CorrectAdaptiveInPlace()

Image & peak::ipl::HotpixelCorrection::CorrectAdaptiveInPlace ( Image &  inputImage)
inline

Corrects the given image inplace adaptively.

For each new passed to this method, first the list of hotpixels is adapted, then all pixels in the adapted hotpixel list are corrected. The image won't be copied.

Parameters
[in]inputImageThe input image.
Returns
Corrected image
Exceptions
ImageFormatNotSupportedExceptioninputImage has a packed pixel format
OutOfRangeExceptioninputImage is too small to process correctly
ExceptionAn internal error has occurred.
Since
1.7

◆ CorrectInPlace()

Image & peak::ipl::HotpixelCorrection::CorrectInPlace ( Image &  inputImage,
const std::vector< Point2D > &  hotpixels 
) const
inline

Corrects the given hotpixels inplace in the given image.

Pass a list of hotpixels, either returned by Detect(), or from a different source (e.g. retrieved directly from the camera from an initial hotpixel calibration). The image won't be copied and the hotpixel will be corrected within the given image.

Parameters
[in]inputImageThe input image.
[in]hotpixelsThe list of hotpixels to be corrected.
Returns
Corrected image
Exceptions
ImageFormatNotSupportedExceptioninputImage has a packed pixel format
OutOfRangeExceptioninputImage is too small to process correctly
ExceptionAn internal error has occurred.
Since
1.7

◆ operator=() [1/2]

HotpixelCorrection & peak::ipl::HotpixelCorrection::operator= ( const HotpixelCorrection &  other)
inline

Copy assigment for HotpixelCorrection instance.

Acquires a reference from other to this instance. If this instance already has a reference, it will be destroyed.

Note
See Shallow copy (since 1.8) for a detailed explanation.
Parameters
[in]otherThe other instance to acquire a reference for.
Since
1.0 Deleted
1.8 Implemented as shallow copy

◆ operator=() [2/2]

HotpixelCorrection & peak::ipl::HotpixelCorrection::operator= ( HotpixelCorrection &&  other)
inlinenoexcept

Move assignment for HotpixelCorrection instance.

Moves the instance from other to this. Afterwards other is invalid.

Parameters
[in]otherThe other instance to move.
Since
1.0

◆ SetGainFactorPercent()

void peak::ipl::HotpixelCorrection::SetGainFactorPercent ( uint32_t  gainFactorPercent = 100)
inline

Sets the gain factor in percent.

Parameters
[in]gainFactorPercentThe gain factor in percent to set.
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ SetSensitivity()

void peak::ipl::HotpixelCorrection::SetSensitivity ( SensitivityLevel  sensitivityLevel = SensitivityLevel::SensitivityLevel3)
inline

Sets the sensitivity of the hotpixel detection.

Parameters
[in]sensitivityLevelThe sensitivity level to set.
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

Member Data Documentation

◆ PEAK_IPL_MAYBE_UNUSED

peak::ipl::HotpixelCorrection::PEAK_IPL_MAYBE_UNUSED = SensitivityLevel Sensitivity() const

The documentation for this class was generated from the following file: